diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-02-08 15:10:06 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-02-08 15:10:06 +0300 |
commit | d0aeb5df3d6b06165355b023a25b79c7bd74a27d (patch) | |
tree | 7b5d3ff0f0ac5c124aa8626aeb4a0682d99a17c2 /scripts | |
parent | 9ccf40d15a14e9ccf613701ba7e3d5d250961345 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/build_qa_image | 10 | ||||
-rw-r--r-- | scripts/utils.sh | 17 |
2 files changed, 24 insertions, 3 deletions
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 +} |