From d0aeb5df3d6b06165355b023a25b79c7bd74a27d Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Wed, 8 Feb 2023 12:10:06 +0000 Subject: Add latest changes from gitlab-org/gitlab@master --- scripts/build_qa_image | 10 +++++++--- scripts/utils.sh | 17 +++++++++++++++++ 2 files changed, 24 insertions(+), 3 deletions(-) (limited to 'scripts') diff --git a/scripts/build_qa_image b/scripts/build_qa_image index 045de2835a4..9c401718336 100755 --- a/scripts/build_qa_image +++ b/scripts/build_qa_image @@ -16,12 +16,16 @@ function latest_stable_tag() { git -c versionsort.prereleaseSuffix=rc tag --sort=-v:refname | awk '!/rc/' | head -1 } -QA_IMAGE_NAME="gitlab-ee-qa" -QA_BUILD_TARGET="ee" - if [[ "${CI_PROJECT_NAME}" == "gitlabhq" || "${CI_PROJECT_NAME}" == "gitlab-foss" || "${FOSS_ONLY}" == "1" ]]; then QA_IMAGE_NAME="gitlab-ce-qa" QA_BUILD_TARGET="foss" +# Build QA Image for JH project +elif [[ "${CI_PROJECT_PATH}" =~ ^gitlab-(jh|cn)\/.*$ || "${CI_PROJECT_NAME}" =~ ^gitlab-jh ]]; then + QA_IMAGE_NAME="gitlab-jh-qa" + QA_BUILD_TARGET="jhqa" +else + QA_IMAGE_NAME="gitlab-ee-qa" + QA_BUILD_TARGET="ee" fi # Tag with commit SHA by default diff --git a/scripts/utils.sh b/scripts/utils.sh index 55005d0abff..5073e89330e 100644 --- a/scripts/utils.sh +++ b/scripts/utils.sh @@ -287,3 +287,20 @@ function setup_gcloud() { gcloud auth activate-service-account --key-file="${REVIEW_APPS_GCP_CREDENTIALS}" gcloud config set project "${REVIEW_APPS_GCP_PROJECT}" } + +function download_files() { + # If public fork, just download the files directly from there. Otherwise, get files from canonical. + if [[ "${CI_PROJECT_VISIBILITY}" == "public" ]]; then + local url="${CI_PROJECT_URL}/raw/${CI_COMMIT_SHA}" + else + local url="https://gitlab.com/gitlab-org/gitlab/raw/master" + fi + + # Loop through all files and download them one by one sequentially. + for file in "$@"; do + local file_url="${url}/${file}" + + echo "Downloading file: ${file_url}" + curl "${file_url}" --create-dirs --output "${file}" + done +} -- cgit v1.2.3