我项目中的GitLab CI有三个阶段(测试,构建,部署)。有些任务总是运行,有些只是手动运行。在部署阶段,我有两个GitLab CI任务:
A:
stage: deploy
when: manual
script:
- echo "Deploy A"
only:
- master
B:
stage: deploy
when: manual
script:
- echo "Deploy B"
only:
- master
如何在任务A完成后自动启动任务B?任务A可以手动启动,但B应该在任务A完成时自动启动。
答案 0 :(得分:0)
这实际上是可行的(参见here),但您需要将作业B放在不同的阶段,并在作业A中将allow_failure设置为false。所以请尝试:
stages:
- deploy
- second-deploy
A:
stage: deploy
when: manual
allow_failure: false
script:
- echo "Deploy A"
only:
- master
B:
stage: second-deploy
script:
- echo "Deploy B"
only:
- master