Commit 065ad31c authored by Lin Jen-Shin's avatar Lin Jen-Shin

Merge branch...

Merge branch '336409-consider-tagging-qa-image-with-the-commit-sha-instead-of-the-branch-name' into 'master'

ci: Tag QA image with the commit SHA instead of branch name

See merge request gitlab-org/gitlab!66390
parents ffeb69ad 75a08c4a
......@@ -25,10 +25,9 @@ build-qa-image:
- .build-images:rules:build-qa-image
stage: build-images
needs: []
variables:
QA_IMAGE: "${CI_REGISTRY}/${CI_PROJECT_PATH}/gitlab-ee-qa:${CI_COMMIT_REF_SLUG}"
script:
- !reference [.base-image-build, script]
- echo $QA_IMAGE
- /kaniko/executor --context=${CI_PROJECT_DIR} --dockerfile=${CI_PROJECT_DIR}/qa/Dockerfile --destination=${QA_IMAGE} --cache=true
# This image is used by:
......
......@@ -51,9 +51,10 @@ update-qa-cache:
image: ${GITLAB_DEPENDENCY_PROXY}ruby:2.7-alpine
stage: qa
retry: 0
script:
before_script:
- source scripts/utils.sh
- install_gitlab_gem
script:
- ./scripts/trigger-build omnibus
package-and-qa:
......
......@@ -114,7 +114,7 @@ review-stop:
extends:
- .use-docker-in-docker
image:
name: ${CI_REGISTRY}/${CI_PROJECT_PATH}/gitlab-ee-qa:${CI_COMMIT_REF_SLUG}
name: ${QA_IMAGE}
entrypoint: [""]
stage: qa
needs: ["build-qa-image", "review-deploy"]
......
......@@ -364,11 +364,19 @@
when: never
- <<: *if-dot-com-gitlab-org-and-security-merge-request
changes: *ci-build-images-patterns
variables:
QA_IMAGE: "${CI_REGISTRY}/${CI_PROJECT_PATH}/gitlab-ee-qa:${CI_MERGE_REQUEST_SOURCE_BRANCH_SHA}"
- <<: *if-dot-com-gitlab-org-and-security-merge-request
changes: *code-qa-patterns
variables:
QA_IMAGE: "${CI_REGISTRY}/${CI_PROJECT_PATH}/gitlab-ee-qa:${CI_MERGE_REQUEST_SOURCE_BRANCH_SHA}"
- <<: *if-dot-com-gitlab-org-default-branch
changes: *code-qa-patterns
variables:
QA_IMAGE: "${CI_REGISTRY}/${CI_PROJECT_PATH}/gitlab-ee-qa:${CI_COMMIT_SHA}"
- <<: *if-dot-com-gitlab-org-schedule
variables:
QA_IMAGE: "${CI_REGISTRY}/${CI_PROJECT_PATH}/gitlab-ee-qa:${CI_COMMIT_SHA}"
.build-images:rules:build-assets-image:
rules:
......@@ -580,16 +588,24 @@
when: never
- <<: *if-dot-com-gitlab-org-and-security-merge-request
changes: *ci-qa-patterns
variables:
QA_IMAGE: "${CI_REGISTRY}/${CI_PROJECT_PATH}/gitlab-ee-qa:${CI_MERGE_REQUEST_SOURCE_BRANCH_SHA}"
allow_failure: true
- <<: *if-dot-com-gitlab-org-and-security-merge-request
changes: *qa-patterns
variables:
QA_IMAGE: "${CI_REGISTRY}/${CI_PROJECT_PATH}/gitlab-ee-qa:${CI_MERGE_REQUEST_SOURCE_BRANCH_SHA}"
allow_failure: true
- <<: *if-dot-com-gitlab-org-and-security-merge-request
changes: *code-patterns
when: manual
variables:
QA_IMAGE: "${CI_REGISTRY}/${CI_PROJECT_PATH}/gitlab-ee-qa:${CI_MERGE_REQUEST_SOURCE_BRANCH_SHA}"
allow_failure: true
- <<: *if-dot-com-gitlab-org-schedule
allow_failure: true
variables:
QA_IMAGE: "${CI_REGISTRY}/${CI_PROJECT_PATH}/gitlab-ee-qa:${CI_COMMIT_SHA}"
###############
# Rails rules #
......@@ -1202,11 +1218,17 @@
when: never
- <<: *if-dot-com-gitlab-org-merge-request
changes: *ci-review-patterns
variables:
QA_IMAGE: "${CI_REGISTRY}/${CI_PROJECT_PATH}/gitlab-ee-qa:${CI_MERGE_REQUEST_SOURCE_BRANCH_SHA}"
- <<: *if-dot-com-gitlab-org-merge-request
changes: *frontend-patterns
variables:
QA_IMAGE: "${CI_REGISTRY}/${CI_PROJECT_PATH}/gitlab-ee-qa:${CI_MERGE_REQUEST_SOURCE_BRANCH_SHA}"
allow_failure: true
- <<: *if-dot-com-gitlab-org-merge-request
changes: *code-qa-patterns
variables:
QA_IMAGE: "${CI_REGISTRY}/${CI_PROJECT_PATH}/gitlab-ee-qa:${CI_MERGE_REQUEST_SOURCE_BRANCH_SHA}"
allow_failure: true
# The rule needs to be duplicated between `on_success` and `on_failure`
......@@ -1242,9 +1264,13 @@
- <<: *if-dot-com-gitlab-org-merge-request
changes: *code-patterns
when: manual
variables:
QA_IMAGE: "${CI_REGISTRY}/${CI_PROJECT_PATH}/gitlab-ee-qa:${CI_MERGE_REQUEST_SOURCE_BRANCH_SHA}"
allow_failure: true
- <<: *if-dot-com-gitlab-org-merge-request
changes: *qa-patterns
variables:
QA_IMAGE: "${CI_REGISTRY}/${CI_PROJECT_PATH}/gitlab-ee-qa:${CI_MERGE_REQUEST_SOURCE_BRANCH_SHA}"
allow_failure: true
# The rule needs to be duplicated between `on_success` and `on_failure`
......
......@@ -143,7 +143,7 @@ module Trigger
{
'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']}",
'QA_IMAGE' => ENV['QA_IMAGE'],
'SKIP_QA_DOCKER' => 'true',
'ALTERNATIVE_SOURCES' => 'true',
'SECURITY_SOURCES' => Trigger.security? ? 'true' : 'false',
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment