我配置了一个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