azure-devopsms-release-managementazure-pipelines

VSTS Release Management: filter by branch on artifact source


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?


Solution

  • 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