I'm trying to trigger a deployment pipeline after a build pipeline completes, so that I can have the status of the pipelines kept separate (the current UI presents confusing status values when everything is in the same pipeline in stages). The deployment pipeline has a resource definition as outlined in the documentation and that refers to the build pipeline. The build pipeline is named "BuildTheApp" and is in the root pipeline folder.
The resource dependency on the build pipeline is defined in the deployment pipeline as below, and there are no other triggers defined, and there is not any override of the yaml trigger in the pipeline definition:
resources:
pipelines:
- pipeline: BuildPipeline
source: BuildTheApp
trigger: true
pipeline: BuildPipeline
is just the name for use within the deployment pipeline.source: BuildTheApp
refers to the name of the build pipeline.
I know that it is picking up the name of the build pipeline correctly because when I created another pipeline named BuildTheApp in another folder, the deploy pipeline gave an error about matching multiple potential definitions.
The deploy pipeline never executes after the build pipeline is run. It doesn't matter whether the build pipeline executed because of its branch-change trigger or if it is executed manually.
The deploy pipeline always executes when the branch changes, at the same time as the build pipeline.
In the deploy pipeline, echo 'Build reason $(Build.Reason)'
results in Build reason IndividualCI
, proving that the pipeline is executed via a CI trigger.
I don't know why the deploy pipeline is executing on code changes without any trigger to do so. The default behavior should be to not execute. And of course, it's not executing when the build pipeline completes, either.
Template files are used in both the build and the deploy pipelines to reduce redundant code.