![]() If none are found, the job downloads all the Ruby dependencies without using a cache,īut creates a new cache for cache-$CI_COMMIT_REF_SLUG when the job completes.įallback keys follow the same processing logic as cache:key:.If cache-$CI_DEFAULT_BRANCH is also not found, the job looks for cache-default.If cache-$CI_COMMIT_REF_SLUG is not found, the job looks for cache-$CI_DEFAULT_BRANCH.The job looks for the cache-$CI_COMMIT_REF_SLUG cache.Test-job : stage : build cache : - key : cache-$CI_COMMIT_REF_SLUG fallback_keys : - cache-$CI_DEFAULT_BRANCH - cache-default paths : - vendor/ruby script : - bundle config set -local path 'vendor/ruby' - bundle install - echo Run tests. 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.Use a variable to control a job’s cache policy. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |