Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
648655d5
Commit
648655d5
authored
Dec 17, 2020
by
Marius Bobin
Committed by
Marcel Amirault
Dec 17, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add caching example for the prefix keyword
Add caching example for the prefix keyword
parent
86a35180
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
0 deletions
+31
-0
doc/ci/caching/index.md
doc/ci/caching/index.md
+31
-0
No files found.
doc/ci/caching/index.md
View file @
648655d5
...
...
@@ -316,6 +316,37 @@ rspec:
-
rspec spec
```
If you have jobs that each need a different selection of gems, use the
`prefix`
keyword in the global
`cache`
definition. This configuration generates a different
cache for each job.
For example, a testing job might not need the same gems as a job that deploys to
production:
```
yaml
cache
:
key
:
files
:
-
Gemfile.lock
prefix
:
${CI_JOB_NAME}
paths
:
-
vendor/ruby
test_job
:
stage
:
test
before_script
:
-
bundle install --without production --path vendor/ruby
script
:
-
bundle exec rspec
deploy_job
:
stage
:
production
before_script
:
-
bundle install --without test --path vendor/ruby
script
:
-
bundle exec deploy
```
### Caching Go dependencies
Assuming your project is using
[
Go Modules
](
https://github.com/golang/go/wiki/Modules
)
to install
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment