| 写法 | needs: [job-a, job-b] |
|---|---|
| 空依赖 | needs: [] 让作业从流水线开始即运行 |
| 跨阶段 | 可依赖较早阶段的任意作业 |
| 可视化 | 流水线图中显示依赖箭头 |
DAG 依赖
DAG 依赖
build:
stage: build
script: [make build]
test:
stage: test
needs: [build]
script: [make test]
deploy:
stage: deploy
needs: [test]
script: [make deploy]DAG 能把长流水线的总时长从「阶段串行」压缩为「依赖链最长路径」。