0
votes

As a follow up to my previous question How do I set up different pipelines for each branch in Azure

I want to trigger the build based on a different branch so if I build the branch virt/master on a project multi-branch using the pipeline multi-branch (virt) I am setting up my deploy-virt pipeline as

trigger:
- master

resources:
 pipelines:
   - pipeline: virt
     project: experiments
     source: multi-branch (virt)
     trigger:
      branches:
        - virt/master

However, making a change on the virt/master branch which runs the multi-branch (virt) pipeline does no trigger my deploy-virt pipeline.

Same sort of question, am I missing something [hopefully obvious] or am I facing a bug in Azure DevOps Pipelines.

Closest but not quite duplicate How to trigger azure pipeline in one topic branch during push for another topic branch because that one is looking at a repo push rather than a pipeline execution.

deploy-virt pipeline code.

1

1 Answers

0
votes

OK it's something obvious

trigger:
- master

resources:
 pipelines:
   - pipeline: virt
     project: experiments
     source: multi-branch (virt)
     branch: virt/master # this one
     trigger:
      branches:
        - virt/master

The documentation wasn't really clear on this (emphasis mine)

branch: string # branch to pick the artifact, optional; defaults to all branches; Used only for manual or scheduled triggers

But adding it seems to make it work considering this wasn't a manual/scheduled.