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:
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.
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.):
Edit the pipeline definition from DevOps pipeline:
This is the .yml file my pipeline is based on:
You can change the YAML file your pipeline based on via the follow steps:
Since my pipeline is based on azure-pipeline.yml, let see what will happen if the commit been submit to branch dev3 and master:
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.