diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-05-19 18:44:42 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-05-19 18:44:42 +0300 |
commit | 4555e1b21c365ed8303ffb7a3325d773c9b8bf31 (patch) | |
tree | 5423a1c7516cffe36384133ade12572cf709398d /.gitlab/ci/cache-repo.gitlab-ci.yml | |
parent | e570267f2f6b326480d284e0164a6464ba4081bc (diff) |
Add latest changes from gitlab-org/gitlab@13-12-stable-eev13.12.0-rc42
Diffstat (limited to '.gitlab/ci/cache-repo.gitlab-ci.yml')
-rw-r--r-- | .gitlab/ci/cache-repo.gitlab-ci.yml | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/.gitlab/ci/cache-repo.gitlab-ci.yml b/.gitlab/ci/cache-repo.gitlab-ci.yml index 475cbca3156..98c8c72ae3a 100644 --- a/.gitlab/ci/cache-repo.gitlab-ci.yml +++ b/.gitlab/ci/cache-repo.gitlab-ci.yml @@ -28,9 +28,9 @@ cache-repo: before_script: - '[ -z "$CI_REPO_CACHE_CREDENTIALS" ] || gcloud auth activate-service-account --key-file=$CI_REPO_CACHE_CREDENTIALS' script: - # Enable shallow repo caching only if the $ENABLE_SHALLOW_REPO_CACHING variable exists + # Enable shallow repo caching unless the $DISABLE_SHALLOW_REPO_CACHING variable exists (in the case the shallow clone caching isn't working well) # The `git repack` call works around a Git bug with shallow clones: https://gitlab.com/gitlab-org/git/-/issues/86 - - if [ -n "$ENABLE_SHALLOW_REPO_CACHING" ]; then + - if [ -z "$DISABLE_SHALLOW_REPO_CACHING" ]; then cd .. && rm -rf $CI_PROJECT_NAME; today=$(date +%Y-%m-%d); year=$(date +%Y); @@ -47,8 +47,8 @@ cache-repo: time gzip /tmp/$SHALLOW_CLONE_TAR_FILENAME; [ -z "$CI_REPO_CACHE_CREDENTIALS" ] || (echo "Uploading /tmp/$SHALLOW_CLONE_TAR_FILENAME.gz to GCloud." && time gsutil cp /tmp/$SHALLOW_CLONE_TAR_FILENAME.gz gs://gitlab-ci-git-repo-cache/project-$CI_PROJECT_ID/$SHALLOW_CLONE_TAR_FILENAME.gz); fi - # By default, we want to cache the full repo, unless the $DISABLE_FULL_REPO_CACHING variable exists (in the case the shallow clone caching is working well) - - if [ -z "$DISABLE_FULL_REPO_CACHING" ]; then + # Disable the full repo caching unless the $DISABLE_SHALLOW_REPO_CACHING variable exists (in the case the shallow clone caching isn't working well) + - if [ -n "$DISABLE_SHALLOW_REPO_CACHING" ]; then cd .. && rm -rf $CI_PROJECT_NAME; echo "Cloning $CI_REPOSITORY_URL into $CI_PROJECT_NAME."; time git clone --progress $CI_REPOSITORY_URL $CI_PROJECT_NAME; |