diff options
author | Kamil Trzciński <ayufan@ayufan.eu> | 2017-03-07 11:17:52 +0000 |
---|---|---|
committer | Kamil Trzciński <ayufan@ayufan.eu> | 2017-03-07 11:17:52 +0000 |
commit | ac9d792946deb17a402646e5481087e4d92f88ad (patch) | |
tree | a6894f1b57249cf7828095ed72948d64ac589bba /doc | |
parent | 74bfa8900adbfcbd5300cdeb3205a86d087116cb (diff) | |
parent | 231983205ea72e0caa6f0d26ad2941eaba78ff7d (diff) | |
download | gitlab-ce-ac9d792946deb17a402646e5481087e4d92f88ad.tar.gz |
Merge branch 'set-default-cache-key-for-jobs' into 'master'
Set default cache key to 'default' for jobs
Closes #22419
See merge request !9666
Diffstat (limited to 'doc')
-rw-r--r-- | doc/ci/yaml/README.md | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/doc/ci/yaml/README.md b/doc/ci/yaml/README.md index fd1171eff7e..b25ccd4376e 100644 --- a/doc/ci/yaml/README.md +++ b/doc/ci/yaml/README.md @@ -166,10 +166,11 @@ which can be set in GitLab's UI. cached between jobs. You can only use paths that are within the project workspace. -**By default the caching is enabled per-job and per-branch.** +**By default caching is enabled and shared between pipelines and jobs, +starting from GitLab 9.0** -If `cache` is defined outside the scope of the jobs, it means it is set -globally and all jobs will use its definition. +If `cache` is defined outside the scope of jobs, it means it is set +globally and all jobs will use that definition. Cache all files in `binaries` and `.config`: @@ -202,7 +203,7 @@ rspec: - binaries/ ``` -Locally defined cache overwrites globally defined options. The following `rspec` +Locally defined cache overrides globally defined options. The following `rspec` job will cache only `binaries/`: ```yaml @@ -213,10 +214,15 @@ cache: rspec: script: test cache: + key: rspec paths: - binaries/ ``` +Note that since cache is shared between jobs, if you're using different +paths for different jobs, you should also set a different **cache:key** +otherwise cache content can be overwritten. + The cache is provided on a best-effort basis, so don't expect that the cache will be always present. For implementation details, please check GitLab Runner. @@ -233,6 +239,9 @@ different jobs or even different branches. The `cache:key` variable can use any of the [predefined variables](../variables/README.md). +The default key is **default** across the project, therefore everything is +shared between each pipelines and jobs by default, starting from GitLab 9.0. + --- **Example configurations** |