diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-10-13 09:09:09 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-10-13 09:09:09 +0300 |
commit | 8f71e69fdbb65d2cf95cf16ef5a0add0919edb45 (patch) | |
tree | 0c282e1224b9ff50ba272b698b92919b72973af9 /doc/ci/yaml/README.md | |
parent | f645d7e060e85cbf442b4e86009bc776688e4661 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'doc/ci/yaml/README.md')
-rw-r--r-- | doc/ci/yaml/README.md | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/doc/ci/yaml/README.md b/doc/ci/yaml/README.md index df921925066..0ead0695acc 100644 --- a/doc/ci/yaml/README.md +++ b/doc/ci/yaml/README.md @@ -2819,6 +2819,8 @@ cache: - binaries/ ``` +You can specify a [fallback cache key](#fallback-cache-key) to use if the specified `cache:key` is not found. + ##### `cache:key:files` > [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/18986) in GitLab v12.5. @@ -4404,6 +4406,32 @@ variables: You can set them globally or per-job in the [`variables`](#variables) section. +### Fallback cache key + +> [Introduced](https://gitlab.com/gitlab-org/gitlab-runner/-/merge_requests/1534) in GitLab Runner 13.4. + +You can use the `$CI_COMMIT_REF_SLUG` variable to specify your [`cache:key`](#cachekey). +For example, if your `$CI_COMMIT_REF_SLUG` is `test` you can set a job +to download cache that's tagged with `test`. + +If a cache with this tag is not found, you can use `CACHE_FALLBACK_KEY` to +specify a cache to use when none exists. + +For example: + +```yaml +variables: + CACHE_FALLBACK_KEY: fallback-key + +cache: + key: "$CI_COMMIT_REF_SLUG" + paths: + - binaries/ +``` + +In this example, if the `$CI_COMMIT_REF_SLUG` is not found, the job uses the key defined +by the `CACHE_FALLBACK_KEY` variable. + ### Shallow cloning > Introduced in GitLab 8.9 as an experimental feature. |