Home > other >  azure pipeline build does not getting triggered for other branches other than the pipeline branch
azure pipeline build does not getting triggered for other branches other than the pipeline branch

Time:11-11

I am building a DevOps pipeline with azure-pipeline.yml with the github repository repo1. The pipeline pipe1 is set to branch dev2 of repo1. the structure of the azure-pipeline.yml in dev2 branch as follows:

trigger:
- '*'
resources:
- repo: self

variables:
.....

pr: none //last line

There are 2 problems:

  1. When i push a commit to dev2 the pipeline gets triggered , but when i push a commit to any other branch ex dev3. The pipeline does not get triggered.

  2. Also when i push a commit to master branch it does not get triggered. The master branch does not have any azure-pipeline.yml file.

Can anyone tell me what is missing here and how can i correct that?

CodePudding user response:

From your reply, seems dev3 branch and master branch both doesn't have the .yml file. If so, this problem is caused by incorrect conceptual understanding.

How the whole DevOps pipeline works:

For example, on my side, there are four branches on GitHub side(main, master, dev3,dev2; dev3 and master doesn't have .yml file.):

enter image description here

Edit the pipeline definition from DevOps pipeline:

enter image description here

This is the .yml file my pipeline is based on:

enter image description here

You can change the YAML file your pipeline based on via the follow steps:

enter image description here

enter image description here

Since my pipeline is based on azure-pipeline.yml, let see what will happen if the commit been submit to branch dev3 and master:

enter image description here

enter image description here

enter image description here

In this situation, I am using CI trigger of GitHub, but this CI trigger only exists in main and dev2. Even my commits in dev3 and master been submitted, the pipeline will not monitor these commits.

'Pipeline' concept on DevOps side based on .yml file to monitor changes/commits. No .yml file, pipeline will not been triggered. And this .yml file must be the pipeline related to, otherwise the pipeline will also not monitor.

  • Related