👷 Set pipeline for production on tags
Tim Izzo tim@octree.ch
Fri, 24 Jul 2020 08:31:18 +0000
1 files changed,
3 insertions(+),
6 deletions(-)
jump to
M
.gitlab-ci.yml
→
.gitlab-ci.yml
@@ -31,6 +31,7 @@ stage: build
image: docker:stable-git rules: - if: '$CI_COMMIT_REF_NAME == "master"' + - if: '$CI_COMMIT_TAG =~ /v.*$/' script: - docker login $CI_REGISTRY -u $CI_REGISTRY_USER -p$CI_REGISTRY_PASSWORD - docker pull $CI_REGISTRY_IMAGE:latest || true@@ -94,13 +95,9 @@ stage: deploy
environment: name: production url: $ENV_URL - # rules: - # - if: "$CI_COMMIT_TAG =~ /v.*[^r][^c]$/" - # when: manual + rules: + - if: "$CI_COMMIT_TAG =~ /v.*[^r][^c]$/" image: mwienk/jelastic-cli - when: manual - variables: - CI_COMMIT_TAG: latest # Avant de mettre en place le système de tag, on redéploie toujours le tag latest script: - /root/jelastic/users/authentication/signin --login $JELASTIC_LOGIN --password $JELASTIC_PASSWORD --platformUrl ${JELASTIC_HOSTER:-app.hidora.com} - /root/jelastic/environment/control/redeploycontainerbyid --envName $JELASTIC_ENVNAME --nodeId $JELASTIC_NODEID --tag ${CI_COMMIT_TAG:-$CI_COMMIT_SHORT_SHA} --useExistingVolumes ${USE_EXISTING_VOLUME:-true}