Skip to content
Snippets Groups Projects
Commit 7b19c8e8 authored by Marco De Donno's avatar Marco De Donno
Browse files

Add auto-commit to the production configuration repo

parent 93a9be7c
No related branches found
No related tags found
No related merge requests found
Pipeline #1972 passed
...@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment