trigger-管道触发
多项目管道
跨多个项目设置流水线,以便一个项目中的管道可以触发另一个项目中的管道(微服务).
当前面阶段运行完成后,触发demo/demo-java-service项目master流水线,创建上游管道的用户需要具有对下游项目的访问权限,如果没有则staging作业会被标记为失败
staging:
variables:
ENVIRONMENT: staging
stage: deploy
trigger:
project: demo-java-service
branch: master
strategy: depend #使下游项目执行成功后才会成功
父子管道
创建子管道
stages:
- build
child-a-build:
stage: build
script:
- echo "hello a"
- sleep 10
在父管道中触发自管道
staging2:
variables:
ENVIRONMENT: staging
stage: deploy
trigger:
include: ci/child.yml
strategy: depend