I have two AZDO pipelines, each based on a Github repository with two branches, staging and production. Each pipeline runs, and uses Build.SourceBranch to identify the branch and then uses this to deploy to the same-name environment. I want to make the second pipeline trigger when the first pipeline completes, running for Staging when the first pipeline was on staging, and so on. However this does not happen.
我的第一个管道(ZAZDO称第一管道)利用这一管道确定部署的环境:
trigger:
branches:
include:
- staging
- production
variables:
- name: isProduction
value: $[eq(variables[ Build.SourceBranch ], refs/heads/production )]
- name: isStaging
value: $[eq(variables[ Build.SourceBranch ], refs/heads/staging )]
第二管道(ZAZDO称第二管道)利用:
trigger:
- staging
- production
resources:
pipelines:
- pipeline: contentPipeline # Name of the pipeline resource
source: firstpipeline # Name of the triggering pipeline
trigger:
branches:
include:
- staging
- production
variables:
- name: isProduction
value: $[eq(variables[ Build.SourceBranch ], refs/heads/production )]
- name: isStaging
value: $[eq(variables[ Build.SourceBranch ], refs/heads/staging )]
However, what I find is that the second pipeline does not trigger at all when the first pipeline completes successfully.
My questions
- Is my second pipeline trigger defined correctly?
- If the first pipeline completes on the staging branch, will it trigger the second pipeline for the staging branch as well?
- Will Build.SourceBranch be set to refs/heads/staging or just staging ?
- Why is the second pipeline not triggering? Do I need to also put something in the first pipeline?