我遇到了一个问题,我想在 CircleCi 2.0 配置中使用顺序工作流程。我想要build->test->deploy
,并使用requires
选项,但它一直给我一个配置错误。
这是一个示例脚本:
version: 2
jobs:
build:
...
test:
...
deploy:
...
workflows:
version: 2
myapp_ci:
jobs:
- build
- test:
requires:
- build
- deploy:
requires:
- test
filters:
branches:
only: master
最佳答案
问题实际上是缩进......即使我通过 yml 解析器运行它,您仍然需要为 requires
标记进行第二个缩进。
所以
workflows:
version: 2
myapp_ci:
jobs:
- build
- test:
requires:
- build
成为
workflows:
version: 2
myapp_ci:
jobs:
- build
- test:
requires:
- build
希望这可以节省其他人的时间!
关于yaml - CircleCi 2.0 工作流程需要选项不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50203163/