Commit 75a08c4a authored by Rémy Coutable's avatar Rémy Coutable

ci: Set QA_IMAGE via rules

Signed-off-by: default avatarRémy Coutable <remy@rymai.me>
parent d22e3862
...@@ -7,10 +7,8 @@ ...@@ -7,10 +7,8 @@
- if [ -n "$CI_MERGE_REQUEST_SOURCE_BRANCH_SHA" ]; then - if [ -n "$CI_MERGE_REQUEST_SOURCE_BRANCH_SHA" ]; then
echo "Checking out \$CI_MERGE_REQUEST_SOURCE_BRANCH_SHA ($CI_MERGE_REQUEST_SOURCE_BRANCH_SHA) instead of \$CI_COMMIT_SHA (merge result commit $CI_COMMIT_SHA) so that GitLab image built in omnibus-gitlab-mirror and QA image are in sync."; echo "Checking out \$CI_MERGE_REQUEST_SOURCE_BRANCH_SHA ($CI_MERGE_REQUEST_SOURCE_BRANCH_SHA) instead of \$CI_COMMIT_SHA (merge result commit $CI_COMMIT_SHA) so that GitLab image built in omnibus-gitlab-mirror and QA image are in sync.";
git checkout -f ${CI_MERGE_REQUEST_SOURCE_BRANCH_SHA}; git checkout -f ${CI_MERGE_REQUEST_SOURCE_BRANCH_SHA};
export QA_IMAGE_TAG=$CI_MERGE_REQUEST_SOURCE_BRANCH_SHA;
else else
echo "Building the image from \$CI_COMMIT_SHA ($CI_COMMIT_SHA) for this non-merge result pipeline."; echo "Building the image from \$CI_COMMIT_SHA ($CI_COMMIT_SHA) for this non-merge result pipeline.";
export QA_IMAGE_TAG=$CI_COMMIT_SHA;
fi; fi;
- echo "See https://docs.gitlab.com/ee/development/testing_guide/end_to_end/index.html#with-pipeline-for-merged-results for more details."; - echo "See https://docs.gitlab.com/ee/development/testing_guide/end_to_end/index.html#with-pipeline-for-merged-results for more details.";
retry: 2 retry: 2
...@@ -29,7 +27,7 @@ build-qa-image: ...@@ -29,7 +27,7 @@ build-qa-image:
needs: [] needs: []
script: script:
- !reference [.base-image-build, script] - !reference [.base-image-build, script]
- 'export QA_IMAGE="${CI_REGISTRY}/${CI_PROJECT_PATH}/gitlab-ee-qa:${QA_IMAGE_TAG}"' - echo $QA_IMAGE
- /kaniko/executor --context=${CI_PROJECT_DIR} --dockerfile=${CI_PROJECT_DIR}/qa/Dockerfile --destination=${QA_IMAGE} --cache=true - /kaniko/executor --context=${CI_PROJECT_DIR} --dockerfile=${CI_PROJECT_DIR}/qa/Dockerfile --destination=${QA_IMAGE} --cache=true
# This image is used by: # This image is used by:
......
...@@ -52,12 +52,6 @@ update-qa-cache: ...@@ -52,12 +52,6 @@ update-qa-cache:
stage: qa stage: qa
retry: 0 retry: 0
before_script: before_script:
- if [ -n "$CI_MERGE_REQUEST_SOURCE_BRANCH_SHA" ]; then
export QA_IMAGE_TAG=$CI_MERGE_REQUEST_SOURCE_BRANCH_SHA;
else
export QA_IMAGE_TAG=$CI_COMMIT_SHA;
fi;
- 'export QA_IMAGE="${CI_REGISTRY}/${CI_PROJECT_PATH}/gitlab-ee-qa:${QA_IMAGE_TAG}"'
- source scripts/utils.sh - source scripts/utils.sh
- install_gitlab_gem - install_gitlab_gem
script: script:
......
...@@ -114,7 +114,7 @@ review-stop: ...@@ -114,7 +114,7 @@ review-stop:
extends: extends:
- .use-docker-in-docker - .use-docker-in-docker
image: image:
name: ${CI_REGISTRY}/${CI_PROJECT_PATH}/gitlab-ee-qa:${CI_COMMIT_REF_SLUG} name: ${QA_IMAGE}
entrypoint: [""] entrypoint: [""]
stage: qa stage: qa
needs: ["build-qa-image", "review-deploy"] needs: ["build-qa-image", "review-deploy"]
......
...@@ -363,11 +363,19 @@ ...@@ -363,11 +363,19 @@
when: never when: never
- <<: *if-dot-com-gitlab-org-and-security-merge-request - <<: *if-dot-com-gitlab-org-and-security-merge-request
changes: *ci-build-images-patterns 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 - <<: *if-dot-com-gitlab-org-and-security-merge-request
changes: *code-qa-patterns 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 - <<: *if-dot-com-gitlab-org-default-branch
changes: *code-qa-patterns changes: *code-qa-patterns
variables:
QA_IMAGE: "${CI_REGISTRY}/${CI_PROJECT_PATH}/gitlab-ee-qa:${CI_COMMIT_SHA}"
- <<: *if-dot-com-gitlab-org-schedule - <<: *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: .build-images:rules:build-assets-image:
rules: rules:
...@@ -581,16 +589,24 @@ ...@@ -581,16 +589,24 @@
when: never when: never
- <<: *if-dot-com-gitlab-org-and-security-merge-request - <<: *if-dot-com-gitlab-org-and-security-merge-request
changes: *ci-qa-patterns changes: *ci-qa-patterns
variables:
QA_IMAGE: "${CI_REGISTRY}/${CI_PROJECT_PATH}/gitlab-ee-qa:${CI_MERGE_REQUEST_SOURCE_BRANCH_SHA}"
allow_failure: true allow_failure: true
- <<: *if-dot-com-gitlab-org-and-security-merge-request - <<: *if-dot-com-gitlab-org-and-security-merge-request
changes: *qa-patterns changes: *qa-patterns
variables:
QA_IMAGE: "${CI_REGISTRY}/${CI_PROJECT_PATH}/gitlab-ee-qa:${CI_MERGE_REQUEST_SOURCE_BRANCH_SHA}"
allow_failure: true allow_failure: true
- <<: *if-dot-com-gitlab-org-and-security-merge-request - <<: *if-dot-com-gitlab-org-and-security-merge-request
changes: *code-patterns changes: *code-patterns
when: manual when: manual
variables:
QA_IMAGE: "${CI_REGISTRY}/${CI_PROJECT_PATH}/gitlab-ee-qa:${CI_MERGE_REQUEST_SOURCE_BRANCH_SHA}"
allow_failure: true allow_failure: true
- <<: *if-dot-com-gitlab-org-schedule - <<: *if-dot-com-gitlab-org-schedule
allow_failure: true allow_failure: true
variables:
QA_IMAGE: "${CI_REGISTRY}/${CI_PROJECT_PATH}/gitlab-ee-qa:${CI_COMMIT_SHA}"
############### ###############
# Rails rules # # Rails rules #
...@@ -1203,11 +1219,17 @@ ...@@ -1203,11 +1219,17 @@
when: never when: never
- <<: *if-dot-com-gitlab-org-merge-request - <<: *if-dot-com-gitlab-org-merge-request
changes: *ci-review-patterns 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 - <<: *if-dot-com-gitlab-org-merge-request
changes: *frontend-patterns changes: *frontend-patterns
variables:
QA_IMAGE: "${CI_REGISTRY}/${CI_PROJECT_PATH}/gitlab-ee-qa:${CI_MERGE_REQUEST_SOURCE_BRANCH_SHA}"
allow_failure: true allow_failure: true
- <<: *if-dot-com-gitlab-org-merge-request - <<: *if-dot-com-gitlab-org-merge-request
changes: *code-qa-patterns changes: *code-qa-patterns
variables:
QA_IMAGE: "${CI_REGISTRY}/${CI_PROJECT_PATH}/gitlab-ee-qa:${CI_MERGE_REQUEST_SOURCE_BRANCH_SHA}"
allow_failure: true allow_failure: true
# The rule needs to be duplicated between `on_success` and `on_failure` # The rule needs to be duplicated between `on_success` and `on_failure`
...@@ -1243,9 +1265,13 @@ ...@@ -1243,9 +1265,13 @@
- <<: *if-dot-com-gitlab-org-merge-request - <<: *if-dot-com-gitlab-org-merge-request
changes: *code-patterns changes: *code-patterns
when: manual when: manual
variables:
QA_IMAGE: "${CI_REGISTRY}/${CI_PROJECT_PATH}/gitlab-ee-qa:${CI_MERGE_REQUEST_SOURCE_BRANCH_SHA}"
allow_failure: true allow_failure: true
- <<: *if-dot-com-gitlab-org-merge-request - <<: *if-dot-com-gitlab-org-merge-request
changes: *qa-patterns changes: *qa-patterns
variables:
QA_IMAGE: "${CI_REGISTRY}/${CI_PROJECT_PATH}/gitlab-ee-qa:${CI_MERGE_REQUEST_SOURCE_BRANCH_SHA}"
allow_failure: true allow_failure: true
# The rule needs to be duplicated between `on_success` and `on_failure` # The rule needs to be duplicated between `on_success` and `on_failure`
......
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