diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-06-22 12:07:12 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-06-22 12:07:12 +0300 |
commit | c76417338ee60071aa41cf292e2c189bd5aa839e (patch) | |
tree | 57b80a2cc5740b3a724f47fa881cd75b40679ef5 /scripts/build_assets_image | |
parent | be3e27e39dd5c1a72fd4c296858322748db53a26 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'scripts/build_assets_image')
-rwxr-xr-x | scripts/build_assets_image | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/scripts/build_assets_image b/scripts/build_assets_image index 12beddfa184..60bd9190b74 100755 --- a/scripts/build_assets_image +++ b/scripts/build_assets_image @@ -19,7 +19,12 @@ cp -r public/assets assets_container.build/public/ cp Dockerfile.assets assets_container.build/ COMMIT_REF_SLUG_DESTINATION=${ASSETS_IMAGE_PATH}:${CI_COMMIT_REF_SLUG} -COMMIT_SHA_DESTINATION=${ASSETS_IMAGE_PATH}:${CI_COMMIT_SHA} +# Use CI_MERGE_REQUEST_SOURCE_BRANCH_SHA (MR HEAD commit) so that the image is in sync with Omnibus/CNG images. +# Background: Due to the fact that we cannot retrieve the Merged Commit in the downstream omnibus/CNG pipelines, +# we're building the Omnibus/CNG images for the MR HEAD commit. +# In turn, the assets image also needs to be built from the MR HEAD commit, so that everything is build from the same commit. +# For non-MR commits, we fallback to $CI_COMMIT_SHA. +COMMIT_SHA_DESTINATION=${ASSETS_IMAGE_PATH}:${CI_MERGE_REQUEST_SOURCE_BRANCH_SHA:-$CI_COMMIT_SHA} COMMIT_REF_NAME_DESTINATION=${ASSETS_IMAGE_PATH}:${CI_COMMIT_REF_NAME} DESTINATIONS="--destination=$COMMIT_REF_SLUG_DESTINATION --destination=$COMMIT_SHA_DESTINATION" |