Skip to content

No git clone for some jobs in review-apps pipelines

From Draft to Ready

What does this MR do and why?

Reboot of !108140 (merged), after it has been reverted in !111446 (merged).

We are doing a few things differently in this MR:

  • We download all _VERSION files from the root folder of the project
  • We download the files in parallel using curl --parallel
  • Support for private projects

What does it look like?

Try it out locally

export CI_API_V4_URL=https://gitlab.com/api/v4
export CI_PROJECT_ID=15097062 # Any private project will do
export CI_COMMIT_SHA=master
export FILES_TO_DOWNLOAD=(README.md)

source scripts/utils.sh

# Invalid access token on a private project
export PROJECT_TOKEN_FOR_CI_SCRIPTS_API_USAGE=invalid-access-token
rm -rf urls_outputs.txt && download_files ${FILES_TO_DOWNLOAD}

# curl should return an error (401 or 404)

# Valid access token on a private project
export PROJECT_TOKEN_FOR_CI_SCRIPTS_API_USAGE=valid-access-token
rm -rf urls_outputs.txt && download_files ${FILES_TO_DOWNLOAD}

cat README.md # The correct content should be in this file

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by David Dieulivol

Merge request reports