我有一个基本文件 .gitlab-ci.yml:
include:
- project: 'my-group/my-project'
file: 'test1.yml'
Run Code Online (Sandbox Code Playgroud)
测试1.yml:
stages:
-test_stage1
test_stage1:
stage: test_stage1
script: //some script
Run Code Online (Sandbox Code Playgroud)
它工作正常,test_stage1 运行成功。
现在,如果我还想包含其他文件:
include:
- project: 'my-group/my-project'
file: 'test1.yml'
- project: 'my-group/my-project'
file: 'test2.yml'
Run Code Online (Sandbox Code Playgroud)
测试2.yml:
stages:
-test_stage2
test_stage2:
stage: test_stage2
script: //some script
Run Code Online (Sandbox Code Playgroud)
我收到以下错误:
此 GitLab CI 配置无效:test_stage 作业:stage 参数应为 test_stage2
所以我必须明确添加阶段:
include:
- project: 'my-group/my-project'
file: 'test1.yml'
- project: 'my-group/my-project'
file: 'test2.yml'
stages:
-test_stage1
-test_stage2
Run Code Online (Sandbox Code Playgroud)
它有效。
这是为什么?
我是否能够以某种方式仅包含多个文件并完成所有阶段而不声明它们?
| 归档时间: |
|
| 查看次数: |
3766 次 |
| 最近记录: |