diff options
Diffstat (limited to 'scripts/build_assets_image')
-rwxr-xr-x | scripts/build_assets_image | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/scripts/build_assets_image b/scripts/build_assets_image index 9afada244c8..25b6060b6c4 100755 --- a/scripts/build_assets_image +++ b/scripts/build_assets_image @@ -7,14 +7,11 @@ then fi # Generate the image name based on the project this is being run in -ASSETS_IMAGE_NAME=$(echo ${CI_PROJECT_NAME} | - awk '{ - split($1, p, "-"); - interim = sprintf("%s-assets-%s", p[1], p[2]); - sub(/-$/, "", interim); - print interim - }' -) +ASSETS_IMAGE_NAME="gitlab-assets-ce" +if [[ "${CI_PROJECT_NAME}" == "gitlab-ee" ]] +then + ASSETS_IMAGE_NAME="gitlab-assets-ee" +fi ASSETS_IMAGE_PATH=${CI_REGISTRY}/${CI_PROJECT_PATH}/${ASSETS_IMAGE_NAME} @@ -27,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 |