Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
docker
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
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
ICNML
docker
Commits
7b19c8e8
Commit
7b19c8e8
authored
5 years ago
by
Marco De Donno
Browse files
Options
Downloads
Patches
Plain Diff
Add auto-commit to the production configuration repo
parent
93a9be7c
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Pipeline
#1972
passed
5 years ago
Stage: build
Stage: push
Stage: deploy
Changes
1
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
.gitlab-ci.yml
+13
-2
13 additions, 2 deletions
.gitlab-ci.yml
with
13 additions
and
2 deletions
.gitlab-ci.yml
+
13
−
2
View file @
7b19c8e8
...
@@ -38,8 +38,19 @@ deploy_master:
...
@@ -38,8 +38,19 @@ deploy_master:
only
:
only
:
-
master
-
master
script
:
script
:
-
echo Deploying production on ${PROD_HOST}...
-
eval $(ssh-agent -s)
-
docker -H ${PROD_HOST} service update --force --detach --image=cr.unil.ch/icnml_web:${CI_COMMIT_SHORT_SHA} icnml_web
-
echo "$SSH_CONFIGURATION_KEY" | tr -d '\r' | ssh-add - > /dev/null
-
ssh-add -l
-
git config --global user.name "$(git show -s --format=%an $CI_COMMIT_SHA)"
-
git config --global user.email "$(git show -s --format=%ae $CI_COMMIT_SHA)"
-
PRODDIR=$(mktemp -d)
-
git clone ${PROD_REPO} $PRODDIR
-
cd $PRODDIR
-
git remote show origin
-
sed -i "s/cr.unil.ch\/icnml_web.*$/cr.unil.ch\/icnml_web\:${CI_COMMIT_SHORT_SHA}/g" docker-compose.yml
-
git add docker-compose.yml
-
git commit -m "Container update" -m "Update the docker image of ICNML to ${CI_COMMIT_SHORT_SHA} from the ${CI_PROJECT_URL} repository. Check the source at ${CI_PROJECT_URL}/commit/${CI_COMMIT_SHA}" -m "Regards, the CICD"
-
git push
deploy_develop
:
deploy_develop
:
stage
:
deploy
stage
:
deploy
...
...
This diff is collapsed.
Click to expand it.
Marco De Donno
@mdedonno
mentioned in commit
ICNML/conf/production@2e7b27dc
·
5 years ago
mentioned in commit
ICNML/conf/production@2e7b27dc
mentioned in commit ICNML/conf/production@2e7b27dc562ccc90f4e88bf9763dba08a2b596a5
Toggle commit list
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