caching - 具有多个路径的 GitLab CI 缓存似乎跳过了一个路径
问题描述
我配置了一个 gitlab CI,我在安装阶段有 2 个作业将依赖项拉入缓存位置。然后不同阶段的作业尝试访问这些位置,但似乎只有一个存在。
我根据 Gitlab 提供的 python 示例构建了 CI,可以 [找到这里]。1
我的 .gitlab-ci.yml 文件看起来像这样。
---
cache:
paths:
- foo-1
- foo-2
stages:
- install
- test
install_foo-1_dependencies:
stage: install
script:
- pull foo-1 dependencies
install_foo-2_dependencies:
stage: install
script:
- pull foo-2 dependencies
tags:
- ansible-f5-runner
test_dependencies:
stage: test
script:
- ls foo-1
- ls foo-2
install_foo-1_dependencies 和 install_foo-2_dependencies 的输出清楚地显示了正在创建的缓存。但是,当您查看 test_dependencies 的输出时,似乎只创建了 foo-1 缓存。
install_foo-1_dependencies 输出:
Fetching changes...
Removing foo-1/
Checking cache for default-5...
Successfully extracted cache
Creating cache default-5...
....
foo-1: found 1000 matching files
Created cache
install_foo-2_dependencies 输出:
Fetching changes...
Removing installed-roles/
Checking cache for default-5...
Successfully extracted cache
Creating cache default-5...
....
foo-2: found 1000 matching files
Created cache
test_dependencies 的输出
Fetching changes...
Removing foo-1/
Checking cache for default-5...
....
Successfully extracted cache
$ ls foo-1
files
$ ls foo-2
ls: cannot access foo-2: No such file or directory
解决方案
推荐阅读
- javascript - 根据是否添加了新元素或编辑了现有元素来更新 React.js 中的列表
- python - Python Curl with Variable Encoding
- javascript - 程序在提交表单时没有将用户输入记录到控制台?
- python - 即使在错误条件下,Python lambda 也会返回 true
- spring-boot - JUnit Cucumber 找不到步骤
- java - 添加到 tablerow 的对象不显示?
- jsf - 如何使primefaces数据表中的某些列可拖动
- javascript - ng-View 在 AngularJS 中不起作用
- macos - 在 macOS 达尔文内核版本 17.5.0 上使用 conda 打包 heasoft
- php - Connection refused when running Laravel artisan command with Docker