diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-11-16 21:11:26 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-11-16 21:11:26 +0300 |
commit | 8fa0c53e26c947ac647b8067fde3e9673b77b1a6 (patch) | |
tree | da32e7224125973e9e87d3856fb7e672ff41c8b1 /scripts/build_qa_image | |
parent | 0552020767452da44de2bf5424096f2cb2ea6bf5 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'scripts/build_qa_image')
-rwxr-xr-x | scripts/build_qa_image | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/scripts/build_qa_image b/scripts/build_qa_image index 4b7eb73e784..477bec29ba7 100755 --- a/scripts/build_qa_image +++ b/scripts/build_qa_image @@ -1,8 +1,8 @@ -#!/bin/sh +#!/bin/bash QA_IMAGE_NAME="gitlab-ee-qa" -if [ "${CI_PROJECT_NAME}" == "gitlabhq" ] || [ "${CI_PROJECT_NAME}" == "gitlab-foss" ]; then +if [[ "${CI_PROJECT_NAME}" == "gitlabhq" || "${CI_PROJECT_NAME}" == "gitlab-foss" ]]; then QA_IMAGE_NAME="gitlab-ce-qa" fi @@ -15,24 +15,29 @@ IMAGE_TAG=${CI_COMMIT_TAG#v} IMAGE_TAG=${IMAGE_TAG:-$CI_COMMIT_REF_SLUG} QA_IMAGE_BRANCH="${CI_REGISTRY}/${CI_PROJECT_PATH}/${QA_IMAGE_NAME}:${IMAGE_TAG}" +QA_IMAGE_MASTER="${CI_REGISTRY}/${CI_PROJECT_PATH}/${QA_IMAGE_NAME}:master" -DESTINATIONS="--destination=${QA_IMAGE} --destination=${QA_IMAGE_BRANCH}" +DESTINATIONS="--tag ${QA_IMAGE} --tag ${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" + DESTINATIONS="${DESTINATIONS} --tag $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" \ +docker buildx build \ + --cache-to=type=inline \ + --cache-from="$QA_IMAGE_BRANCH" \ + --cache-from="$QA_IMAGE_MASTER" \ + --platform=${ARCH:-amd64} \ --build-arg=CHROME_VERSION="${CHROME_VERSION}" \ --build-arg=DOCKER_VERSION="${DOCKER_VERSION}" \ --build-arg=RUBY_VERSION="${RUBY_VERSION}" \ --build-arg=QA_BUILD_TARGET="${QA_BUILD_TARGET:-qa}" \ - --cache=true \ - ${DESTINATIONS} + --file="${CI_PROJECT_DIR}/qa/Dockerfile" \ + --push \ + ${DESTINATIONS} \ + ${CI_PROJECT_DIR} |