Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
bodysch-backend
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
JetBrains YouTrack
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
KSZK
DevTeam
org
BodySCH
bodysch-backend
Commits
bc7905b4
Commit
bc7905b4
authored
4 years ago
by
Rafael László
Browse files
Options
Downloads
Patches
Plain Diff
dev branch auto deploy
parent
ca2f0fb9
No related branches found
No related tags found
2 merge requests
!10
Feature/12 dev auto deploy
,
!9
Resolve "Auto dev deploy"
Pipeline
#4736
passed
4 years ago
Stage: Build
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
.gitlab-ci.yml
+86
-0
86 additions, 0 deletions
.gitlab-ci.yml
Dockerfile
+8
-0
8 additions, 0 deletions
Dockerfile
docker-compose.dev.yml
+18
-19
18 additions, 19 deletions
docker-compose.dev.yml
with
112 additions
and
19 deletions
.gitlab-ci.yml
0 → 100644
+
86
−
0
View file @
bc7905b4
stages
:
-
Build
# - Test
-
Docker build
-
Deploy
#services:
# - mongo
variables
:
CONTAINER_IMAGE
:
'
registry.kszk.bme.hu/bodysch/backend:$CI_COMMIT_REF_NAME'
# MONGODB_TEST_URI: 'mongodb://mongo/bodysch-test'
Build
:
stage
:
Build
tags
:
[
kszk
]
image
:
node:14
script
:
-
npm install
cache
:
paths
:
-
node_modules/
artifacts
:
expire_in
:
1 day
paths
:
-
node_modules/
#Test:
# stage: Test
# tags: [kszk]
# image: node:14
# script:
# - npm test
# artifacts:
# expire_in: 1 week
# paths:
# - junit.xml
# reports:
# junit: junit.xml
Docker build
:
stage
:
Docker build
tags
:
[
kszk
]
only
:
-
master
-
dev
image
:
name
:
gcr.io/kaniko-project/executor:debug
entrypoint
:
[
'
'
]
script
:
-
echo "{\"auths\":{\"registry.kszk.bme.hu\":{\"username\":\"$REGISTRY_USER\",\"password\":\"$REGISTRY_PASSWORD\"}}}" > /kaniko/.docker/config.json
-
/kaniko/executor --context $CI_PROJECT_DIR --dockerfile $CI_PROJECT_DIR/Dockerfile --destination $CONTAINER_IMAGE
Deploy dev
:
stage
:
Deploy
tags
:
[
kszk-deploy
]
# request the custom SSH executor
only
:
-
dev
script
:
# your deploy logic
-
echo "$REGISTRY_PASSWORD" | docker login registry.kszk.bme.hu --username $REGISTRY_USER --password-stdin
-
cp docker-compose.dev.yml /home/kszk-gitlab-deployer/bodysch-dev/
-
cd /home/kszk-gitlab-deployer/bodysch-dev/
-
docker-compose -f docker-compose.dev.yml --no-ansi pull
-
docker-compose -f docker-compose.dev.yml up -d
-
docker system prune -f
variables
:
SSH_HOST
:
donald.sch.bme.hu
# required
SSH_USER
:
kszk-gitlab-deployer
# default: kszk-gitlab-deployer
SSH_PORT
:
10122
# default: 22
# Deploy prod:
# stage: Deploy
# tags: [kszk-deploy] # request the custom SSH executor
# only:
# - master
# script: # your deploy logic
# - echo "$REGISTRY_PASSWORD" | docker login registry.kszk.bme.hu --username $REGISTRY_USER --password-stdin
# - cp docker-compose.yml /home/kszk-gitlab-deployer/kszkepzes-prod/
# - cd /home/kszk-gitlab-deployer/kszkepzes-prod/
# - docker-compose --no-ansi pull
# - docker-compose up -d
# - docker system prune -f
# variables:
# SSH_HOST: donald.sch.bme.hu # required
# SSH_USER: kszk-gitlab-deployer # default: kszk-gitlab-deployer
# SSH_PORT: 10122 # default: 22
This diff is collapsed.
Click to expand it.
Dockerfile
0 → 100644
+
8
−
0
View file @
bc7905b4
FROM
node:14
WORKDIR
/usr/src/app
COPY
. .
EXPOSE
3000
CMD
["npm", "run", "start"]
\ No newline at end of file
This diff is collapsed.
Click to expand it.
docker-compose.dev.yml
+
18
−
19
View file @
bc7905b4
version
:
"
3.7"
version
:
'
3.7'
services
:
services
:
bodysch-backend-dev
:
app
:
container_name
:
bodysch-backend-dev
image
:
node:alpine
image
:
registry.kszk.bme.hu/bodysch/backend:dev
volumes
:
restart
:
always
-
./:/app
working_dir
:
/app
depends_on
:
-
mongo
environment
:
NODE_ENV
:
development
ports
:
ports
:
-
8000:8000
-
'
3030:3000'
command
:
npm run start-dev
links
:
-
bodysch-mongo-dev
mongo
:
env_file
:
-
.env
depends_on
:
-
bodysch-mongo-dev
bodysch-mongo-dev
:
container_name
:
bodysch-mongo-dev
image
:
mongo
image
:
mongo
expose
:
-
27017
volumes
:
volumes
:
-
./data/db:/data/db
-
./data:/data/db
\ No newline at end of file
expose
:
-
'
27017'
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment