diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-09-23 18:11:09 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-09-23 18:11:09 +0300 |
commit | 2cba761741967eb6baf797af2ee0a702c2ffbdfe (patch) | |
tree | 4fb91ea33991578c258b1c9f8fdce5dcd4a186ee /scripts/build_qa_image | |
parent | 1ccebc7b3f091ef585dc87a91847aa35f7ae2130 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'scripts/build_qa_image')
-rwxr-xr-x | scripts/build_qa_image | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/scripts/build_qa_image b/scripts/build_qa_image new file mode 100755 index 00000000000..f4ecb8ed6b6 --- /dev/null +++ b/scripts/build_qa_image @@ -0,0 +1,32 @@ +#!/bin/sh + +QA_IMAGE_NAME="gitlab-ee-qa" + +if [ "${CI_PROJECT_NAME}" == "gitlabhq" ] || [ "${CI_PROJECT_NAME}" == "gitlab-foss" ]; then + QA_IMAGE_NAME="gitlab-ce-qa" +fi + +# Tag with commit SHA by default +QA_IMAGE="${CI_REGISTRY}/${CI_PROJECT_PATH}/${QA_IMAGE_NAME}:${CI_COMMIT_SHA}" +# For branches, tag with slugified branch name. For tags, use the tag directly +QA_IMAGE_BRANCH="${CI_REGISTRY}/${CI_PROJECT_PATH}/${QA_IMAGE_NAME}:${CI_COMMIT_TAG:-$CI_COMMIT_REF_SLUG}" + +DESTINATIONS="--destination=${QA_IMAGE} --destination=${QA_IMAGE_BRANCH}" + +# Auto-deploy tag format uses first 12 letters of commit SHA. Tag with that +# reference also for EE images. +if [ "${QA_IMAGE_NAME}" == "gitlab-ee-qa" ]; then + QA_IMAGE_FOR_AUTO_DEPLOY="${CI_REGISTRY}/${CI_PROJECT_PATH}/${QA_IMAGE_NAME}:${CI_COMMIT_SHA:0:11}" + DESTINATIONS="${DESTINATIONS} --destination=$QA_IMAGE_FOR_AUTO_DEPLOY" +fi + +echo "Building QA image for destinations: ${DESTINATIONS}" + +/kaniko/executor \ + --context="${CI_PROJECT_DIR}" \ + --dockerfile="${CI_PROJECT_DIR}/qa/Dockerfile" \ + --build-arg=CHROME_VERSION="${CHROME_VERSION}" \ + --build-arg=DOCKER_VERSION="${DOCKER_VERSION}" \ + --build-arg=QA_BUILD_TARGET="${QA_BUILD_TARGET:-qa}" \ + --cache=true \ + ${DESTINATIONS} |