From 1492204c03eac6e3db055453e2f25f8d62e9be2a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20Coutable?= Date: Tue, 12 Mar 2019 12:40:05 +0000 Subject: Merge branch 'tag-pipeline-asset-image' into 'master' Tag asset docker image with GitLab version also See merge request gitlab-org/gitlab-ce!26029 --- scripts/build_assets_image | 6 ++++++ scripts/trigger-build | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/scripts/build_assets_image b/scripts/build_assets_image index ad5342fe3a1..25b6060b6c4 100755 --- a/scripts/build_assets_image +++ b/scripts/build_assets_image @@ -24,3 +24,9 @@ docker login -u gitlab-ci-token -p ${CI_JOB_TOKEN} ${CI_REGISTRY} docker push ${ASSETS_IMAGE_PATH}:${CI_COMMIT_REF_SLUG} docker push ${ASSETS_IMAGE_PATH}:${CI_COMMIT_SHA} +# Also tag the image with GitLab version, if running on a tag pipeline, so +# other projects can simply use that instead of computing the slug. +if [ -n "$CI_COMMIT_TAG" ]; then + docker tag ${ASSETS_IMAGE_PATH}:${CI_COMMIT_REF_SLUG} ${ASSETS_IMAGE_PATH}:${CI_COMMIT_REF_NAME} + docker push ${ASSETS_IMAGE_PATH}:${CI_COMMIT_REF_NAME} +fi diff --git a/scripts/trigger-build b/scripts/trigger-build index 9dbafffddfc..9c5fc3c76a5 100755 --- a/scripts/trigger-build +++ b/scripts/trigger-build @@ -141,7 +141,7 @@ module Trigger "GITLAB_#{edition}_VERSION" => ENV['CI_COMMIT_REF_NAME'], "GITLAB_VERSION" => ENV['CI_COMMIT_REF_NAME'], "GITLAB_TAG" => ENV['CI_COMMIT_TAG'], - "GITLAB_ASSETS_TAG" => ENV['CI_COMMIT_REF_SLUG'], + "GITLAB_ASSETS_TAG" => ENV['CI_COMMIT_TAG'] ? ENV['CI_COMMIT_REF_NAME'] : ENV['CI_COMMIT_REF_SLUG'], "#{edition}_PIPELINE" => 'true' } end -- cgit v1.2.1