Reputation: 91
We have one build pipeline (Product1) that use multiple branches (dev, test, prod).
In release pipeline/artifacts settings, we use the following settings:
Default version
: Latest from a specific branch with tagsBranch
: $(Branch.name) --> this is settable at release time.The scenario that we are having:
How can we use branch variables in release pipelines?
Upvotes: 5
Views: 1899
Reputation: 30372
As you set the Default version: Latest from a specific branch with tags
.
You need to add tags for builds, then specify the specific tag in artifacts settings, otherwise it will use the last successful builds generated from the build pipeline (will ignore the specified branch).
For example, in below screenshot I added a tag master
for the successful build using the master branch, then specify the tag in Artifact
settings. Thus when you create a release it will automatically select the latest build which has the tag master
and using master branch.
Upvotes: 3