From f8871a73e2a97a819d295e4a7e00f0e45e6d3d08 Mon Sep 17 00:00:00 2001 From: s3lph Date: Thu, 2 Aug 2018 21:55:22 +0200 Subject: [PATCH] GitLab CI: Build an image tagged latest-stable for master. --- .gitlab-ci.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 9ac4c38..9eac494 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -24,12 +24,13 @@ build: stage: build script: - docker build -t "registry.gitlab.com/s3lph/matemat:$(git rev-parse HEAD)" . - - docker tag "registry.gitlab.com/s3lph/matemat:$(git rev-parse HEAD)" registry.gitlab.com/s3lph/matemat:latest-staging + - docker tag "registry.gitlab.com/s3lph/matemat:$(git rev-parse HEAD)" "registry.gitlab.com/s3lph/matemat:latest-$([[ $(git symbolic-ref --short HEAD) == "master" ]] && echo stable || staging)" - docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_TOKEN registry.gitlab.com - docker push "registry.gitlab.com/s3lph/matemat:$(git rev-parse HEAD)" - - docker push registry.gitlab.com/s3lph/matemat:latest-staging + - docker push registry.gitlab.com/s3lph/matemat:latest-$([[ $(git symbolic-ref --short HEAD) == "master" ]] && echo stable || staging) only: - staging + - master staging: stage: staging