diff --git a/.gitlab/ci/build-images.gitlab-ci.yml b/.gitlab/ci/build-images.gitlab-ci.yml index e6c3e7598d39eef8560a1c573cacd12a4d8dc36f..4e35247204751bfc7954cca92d94eb2774233c96 100644 --- a/.gitlab/ci/build-images.gitlab-ci.yml +++ b/.gitlab/ci/build-images.gitlab-ci.yml @@ -1,6 +1,8 @@ -# This image is used by the `review-qa-*` jobs. Not currently used by the `omnibus-gitlab` pipelines which rebuild this -# image, e.g. https://gitlab.com/gitlab-org/build/omnibus-gitlab-mirror/-/jobs/587107399, which we could probably avoid. -# See https://gitlab.com/gitlab-org/omnibus-gitlab/-/issues/5429. +# This image is used by the `review-qa-*` jobs. The image name is also passed to the downstream `omnibus-gitlab-mirror` pipeline +# triggered by `package-and-qa` so that it doesn't have to rebuild it a second time. The downstream `omnibus-gitlab-mirror` pipeline +# itself passes the image name to the `gitlab-qa-mirror` pipeline so that it can use it instead of inferring an end-to-end image +# from the GitLab image built by the downstream `omnibus-gitlab-mirror` pipeline. +# See https://docs.gitlab.com/ee/development/testing_guide/end_to_end/index.html#testing-code-in-merge-requests for more details. build-qa-image: extends: - .use-kaniko diff --git a/scripts/trigger-build b/scripts/trigger-build index 28f514dd799991741235f17754a8f034c2a16735..c81af332b0e4a68c33aa2a9c582b5af6e88a3643 100755 --- a/scripts/trigger-build +++ b/scripts/trigger-build @@ -136,13 +136,15 @@ module Trigger def extra_variables # Use CI_MERGE_REQUEST_SOURCE_BRANCH_SHA for omnibus checkouts due to pipeline for merged results - # and fallback to CI_COMMIT_SHA for the `detached` pipelines. - # We also set IMAGE_TAG so the GitLab and QA docker images are tagged with - # that SHA. + # and fallback to CI_COMMIT_SHA (merged result commit) for the non-MR pipelines. + # See https://docs.gitlab.com/ee/development/testing_guide/end_to_end/index.html#with-pipeline-for-merged-results. + # We also set IMAGE_TAG so the GitLab Docker image is tagged with that SHA. source_sha = Trigger.non_empty_variable_value('CI_MERGE_REQUEST_SOURCE_BRANCH_SHA') || ENV['CI_COMMIT_SHA'] { 'GITLAB_VERSION' => source_sha, 'IMAGE_TAG' => source_sha, + 'QA_IMAGE' => "#{ENV['CI_REGISTRY']}/#{ENV['CI_PROJECT_PATH']}/gitlab-ee-qa:#{ENV['CI_COMMIT_REF_SLUG']}", + 'SKIP_QA_DOCKER' => 'true', 'ALTERNATIVE_SOURCES' => 'true', 'SECURITY_SOURCES' => Trigger.security? ? 'true' : 'false', 'ee' => Trigger.ee? ? 'true' : 'false',