cache – policy

Under default circumstances, the cache is downloaded before every job and then re-uploaded at the end of the job. This is equivalent to setting the following:

job:  cache:    policy: push-pull

You may have a pipeline with jobs that would use a cache but not alter the contents of the cache. A good example is having one job that downloads all of the required packages and builds assets, and then subsequent jobs that simply run tests. In these cases, you can set policy: pull, which will download the cache at the start of the job but skip the uploading phase to save time. Conversely, if you have a job that always creates the contents of a cache, you can set policy: push, which will skip the download phase but always run the upload step ...

Get GitLab Quick Start Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.