

Docker Machine (autoscale runners) The same as the Docker executor. Docker Locally, under Docker volumes: /var/lib/docker/volumes//_data////cache.zip. Runner executor Default path of the cache Shell Locally, under the gitlab-runner user’s home directory: /home/gitlab-runner/cache////cache.zip. The location also depends on the type of executor. Is stored on the machine where GitLab Runner is installed. The runner configuration defines where the file is stored. Where the caches are storedĪll caches defined for a job are archived in a single cache.zip file. Whether different runners are used to pass the cache between jobs.

The availability of the cache depends on: To regenerate cached files in each job that needs them.Īfter you define a cache in. v -short Availability of the cacheĬaching is an optimization, but it isn’t guaranteed to always work. go/pkg/mod/ test : image : golang:1.13 extends. go-cache : variables : GOPATH : $CI_PROJECT_DIR/.go before_script : - mkdir -p. This directory should use NFS or something similar. Share a common network-mounted directory to store the cache. Use multiple runners with the same architecture and have these runners.You can configure a different cache for each branch.įor runners to work with caches efficiently, you must do one of the following: Use runners that are only available to a particular project.Tag your runners and use the tag on jobs.To ensure maximum availability of the cache, do one or more of the following: Use dependencies to control which jobs fetch the artifacts.The latest artifacts do not expire if keep latest artifacts is enabled.Artifacts expire after 30 days by default.Different projects cannot share artifacts.Subsequent jobs in later stages of the same pipeline can use artifacts.By default, protected and non-protected branches do not share the cache.Different projects cannot share the cache.Subsequent jobs in the same pipeline can use the cache, if the dependencies are identical.Subsequent pipelines can use the cache.Define cache per job by using the cache keyword.Use artifacts to pass intermediate build results between stages.Īrtifacts are generated by a job, stored in GitLab, and can be downloaded.īoth artifacts and caches define their paths relative to the project directory, and Use cache for dependencies, like packages you download from the internet.Ĭache is stored where GitLab Runner is installed and uploaded to S3 if To learn how to define the cache in your. The same cache don’t have to download the files again, so they execute more quickly. Cache mismatch example 2 Caching in GitLab CI/CDĪ cache is one or more files a job downloads and saves.Compute the cache key from the lock file.Share caches across jobs in different branches.Share caches between jobs in the same branch.Inherit global configuration, but override specific settings per job.
