I have a branch that id like to use to do builds from. When work on a feature branch is done and Im ready to build to dev, I will just merge into the "dev" branch.
When I first start with the pipeline wizard, it wants to use the master branch for the source. I see nowhere to specify a different branch. Do I have to just go through the rest of the steps then edit the yaml file to use a different branch?
[update]
So should I keep the yaml file in the same branch that I want to build/release from?
In my yaml file, I see a spot for the CI trigger, where I have put:
trigger:
but the yaml file itself is in the master branch
I see this in the job step for getting the source:
From repo-url-here....
* [new branch] dev -> origin/dev
* [new branch] master -> origin/master
Do I have to just go through the rest of the steps then edit the yaml file to use a different branch?
The answer is yes.
There is an option Existing Azure pipelineYAML file when you Configure your pipeline:
Only the yaml file exists only on a specific branch, we can use this option to use specify a different branch.
If the yaml file exists on the master and specify branch, Azure pipeline use the master branch for the source by default. In this case, we have to just go through the rest of the steps then edit the yaml file to change the Default branch for manual and scheduled builds
to use a different branch.
Update:
So should I keep the yaml file in the same branch that I want to build/release from? In my yaml file, I see a spot for the CI trigger, where I have put:
trigger:
dev
but the yaml file itself is in the master branch
The answer is yes. In this case, we need also keep the yaml file in the Dev
branch, so we could change the Default branch for manual and scheduled builds
:
Now, we change the Default branch for manual and scheduled builds
, More action-> Triggers -> Select YAML
tab:
When we execute the pipeline (No interface for editing YAML files), it execute the YAML in the DEV
branch:
So, we could specify a different branch for this pipeline. And we could not directly choose different branches when choosing a template.
Note: When we edit the pipeline, it still show the YAML file in the master by default.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With