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
ca2a8812
Commit
ca2a8812
authored
Jan 11, 2022
by
Simon Legner
Committed by
Marcel Amirault
Jan 11, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
caching: package-lock.json and yarn-offline-mirror
parent
3709b852
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
0 deletions
+33
-0
doc/ci/caching/index.md
doc/ci/caching/index.md
+33
-0
No files found.
doc/ci/caching/index.md
View file @
ca2a8812
...
...
@@ -235,6 +235,39 @@ test_async:
-
node ./specs/start.js ./specs/async.spec.js
```
#### Compute the cache key from the lock file
You can use
[
`cache:key:files`
](
../yaml/index.md#cachekeyfiles
)
to compute the cache
key from a lock file like
`package-lock.json`
or
`yarn.lock`
, and reuse it in many jobs.
```
yaml
# Cache modules using lock file
cache
:
key
:
files
:
-
package-lock.json
paths
:
-
.npm/
```
If you're using
[
Yarn
](
https://yarnpkg.com/
)
, you can use
[
`yarn-offline-mirror`
](
https://classic.yarnpkg.com/blog/2016/11/24/offline-mirror/
)
to cache the zipped
`node_modules`
tarballs. The cache generates more quickly, because
fewer files have to be compressed:
```
yaml
job
:
script
:
-
echo 'yarn-offline-mirror ".yarn-cache/"' >> .yarnrc
-
echo 'yarn-offline-mirror-pruning
true
' >> .yarnrc
-
yarn install --frozen-lockfile --no-progress
cache
:
key
:
files
:
-
yarn.lock
paths
:
-
.yarn-cache/
```
### Cache PHP dependencies
If your project uses
[
Composer
](
https://getcomposer.org/
)
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