我遇到了一个问题,我希望在我的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
答案 0 :(得分:2)
问题实际上是缩进...即使我通过yml解析器运行它,你需要对requires
标记进行第二次缩进。
所以
workflows:
version: 2
myapp_ci:
jobs:
- build
- test:
requires:
- build
变为
workflows:
version: 2
myapp_ci:
jobs:
- build
- test:
requires:
- build
希望这能节省一些时间!