diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-02-08 12:10:06 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-02-08 12:10:06 +0000 |
commit | d0aeb5df3d6b06165355b023a25b79c7bd74a27d (patch) | |
tree | 7b5d3ff0f0ac5c124aa8626aeb4a0682d99a17c2 /scripts/utils.sh | |
parent | 9ccf40d15a14e9ccf613701ba7e3d5d250961345 (diff) | |
download | gitlab-ce-d0aeb5df3d6b06165355b023a25b79c7bd74a27d.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'scripts/utils.sh')
-rw-r--r-- | scripts/utils.sh | 17 |
1 files changed, 17 insertions, 0 deletions
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 +} |