summaryrefslogtreecommitdiff
path: root/scripts/build_assets_image
diff options
context:
space:
mode:
authorBalasankar "Balu" C <balasankar@gitlab.com>2019-03-12 16:37:56 +0530
committerBalasankar "Balu" C <balasankar@gitlab.com>2019-03-12 16:41:50 +0530
commit24426f37d7eb084f8dc68686249e3b3f0a0bb169 (patch)
tree48ccff242d769f624d582e62f654a9e5d33d913d /scripts/build_assets_image
parente4b2c3b08b0aced417e072e60d5b299144c40474 (diff)
downloadgitlab-ce-24426f37d7eb084f8dc68686249e3b3f0a0bb169.tar.gz
Tag asset docker image with GitLab version also
Signed-off-by: Balasankar "Balu" C <balasankar@gitlab.com>
Diffstat (limited to 'scripts/build_assets_image')
-rwxr-xr-xscripts/build_assets_image6
1 files changed, 6 insertions, 0 deletions
diff --git a/scripts/build_assets_image b/scripts/build_assets_image
index 9afada244c8..b659bd751b2 100755
--- a/scripts/build_assets_image
+++ b/scripts/build_assets_image
@@ -27,3 +27,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