Gitlab CI未缓存
我有以下gitlab ci yaml文件:Gitlab CI未缓存,gitlab,gitlab-ci,gitlab-8,Gitlab,Gitlab Ci,Gitlab 8,我有以下gitlab ci yaml文件: image: steveedson/ci stages: - build cache: untracked: true key: "$CI_PROJECT_ID" paths: - node_modules/ - _site/vendor/ - .bundled/ - .yarn build: stage: build script: - ls -l - yarn confi
image: steveedson/ci
stages:
- build
cache:
untracked: true
key: "$CI_PROJECT_ID"
paths:
- node_modules/
- _site/vendor/
- .bundled/
- .yarn
build:
stage: build
script:
- ls -l
- yarn config set cache-folder .yarn
- yarn install
- ...
当我的成功构建完成时,它们会显示:
Creating cache 1970478...
Created cache
当下一次提交触发构建时,我得到:
Checking cache for 1970478...
Successfully extracted cache
但是我第一步中的ls-l
没有显示缓存的目录。我已尝试缓存缓存密钥,但这没有帮助
这是在gitlab.com上运行的,不是专用服务器。因此,我的配置是正确的,gitlab确实支持作业之间的缓存,但是他们还没有将其添加到gitlab.com上的共享运行程序中
问题就在这里,应该很快添加。如果您在本地使用以下内容运行配置,则缓存似乎不起作用:
sudo gitlab runner exec docker测试——docker image“image/image”
有一次我通过Gitlab实例缓存测试了这一点。这也不适合我,但我使用的是一个特定的运行程序,不是Gitlab.com上的共享运行程序,也不是私有实例。结果是Runner 9.0有一个bug。9.0.1修复了它。通常,在docker executor中处理缓存失败。注意:Gitlab中的共享运行程序不支持作业/管道之间的缓存。