0
votes

Microsoft have added ability to define a VSTS Release Trigger for a specific branch only. It's listed as "Release management orchestration improvements – branch conditions, multiple artifact triggers" on the Features Timeline.

We do use branches and PR builds too, but we only release code from Git master branch. In the past we even had to create a custom extension for this.

However it's still not working as expected in case of multiple builds taken to a Release. Consider this scenario:

  1. We have component A and component B, both produce builds for master branch, as well as other branches and PRs.
  2. We have a single Release definition with 2 triggers defined for both builds for master branch only.
  3. On Artifacts tab we added both builds with the option "Latest", as two other options are manual and so won't conform to Continuous Deployment principle.
  4. When component A is built for master, it triggers a Release which takes artifacts from this Latest master build of component A.
  5. But the build taken for component B can be for any branch\PR, whatever is the latest.

Is there any way to ensure that only specific branch builds are taken into Release (master builds in my case)?

See screenshot below.

1) Configuration of triggers for 2 builds.

enter image description here

2) Artifact source taken is the Latest version

enter image description here

3) Some releases are still triggered for other branches (not master in this case):

enter image description here

1
Stop producing release artifacts for your PRs. If you're on Azure DevOps or seeing the new options in VSTS, see my answer on this question.Josh Gust

1 Answers

2
votes

What you want is the ability for an artifact where the default version is "Latest from a specific branch"

This feature is currently under preview for a selected set of customers and will be released soon for a wider audience.

enter image description here