VSTS Release Management: filter by branch on artif

2019-04-20 14:18发布

I am using VSTS build to run a CI build. This build definition is the same for all my git branches (master, develop, features, etc).

I am now trying to implement a deployment pipeline using VSTS release management. I plan to have two distinct release definitions. One for feature branches and one for the more important branches like develop and master. The release definition for feature branches would be more lightweight.

I think this is pretty basic and usual. In fact, that's pretty much what is documented in Microsoft's typical use case for Release Management.

For both of these pipelines, I want to configure them to start automatically using the 'Continuous Deployment' trigger. When I select this trigger, I must select an artifact source.

Unfortunately, an artifact source takes all artifacts (regardless of the branch) coming from a given build definition (my CI build). Since I use the same CI build definition for all my branches, it looks like I can't configure my two release pipelines in 'Continuous Deployment' and still use the same build definition as an artifact source.

Anybody knows how to share the same build definition for multiple release definitions but only start a release for a specific branch? Anybody knows of a way to filter by branch when we define an artifact source?

2条回答
我命由我不由天
2楼-- · 2019-04-20 14:43

Configure branch specific release deployment

  1. Go to release management in VSTS
  2. Go to the definition of the release
  3. Go to tab triggers
  4. Add Continuous Deployment trigger
  5. Here you can select a specific branch (for branch)

Release trigger definition

Availability of feature

  • This feature is available in VSTS
  • In the TFS on-premise version it was supposed to be available in version Server 2017.1 but it is still not available in version 2018.1
查看更多
爷、活的狠高调
3楼-- · 2019-04-20 14:43

Currently there is no way in VSTS Release Management to do conditional deployment based on branch.

An alternate would be to create separate BDs for different branches and then configure them as artifact sources for the RDs.

This will also give users a clarity about the artifact from its name itself.

查看更多
登录 后发表回答