Search code examples
gitazure-devopscontinuous-integrationcontinuous-deploymentgit-flow

Deployment triggers on new release branch


I've been doing some research for our team to migrate to a new branching strategy. Currently we are using the github flow with only master and feature branches. But since we have some trouble with hotfixes im thinking that we should migrate to the gitflow using release branches so we have a stable branch where we can do hotfixes when needed. We are using Azure Devops as our platform.

Anyway what im having trouble with so far is how should we trigger our continuous deployment pipelines when we create a new release branch?

Normally pipelines get triggered when a PR is merged and a CI build is run. However when you create a new release branch and want to deploy that to for example an Acceptance environment, how should we trigger those pipelines? Another problem is that we have multiple releaseable components in our repository. So when we create that release branch we would end up having to look up which components we changed, run manual build for them so our pipelines get triggered.

It seems to me this should be a common problem, yet i cant find much information on this, which suggests to me im missing something here. What am i missing?

Regards


Solution

  • How should we trigger our continuous deployment pipelines when we create a new release branch?

    Since the resources you use are on github, you can try the following triggers configuration in Azure Devops Build Pipeline(CI) and Release Pipeline(CD).

    Build Pipeline: You could add release branch to the branch filters. Then when you create a release branch or make changes in these two branches, the Pipeline will be triggered.

    enter image description here

    Release Pipeline: You could add the Build as artifacts resources. And you could also add the Release branch as the continuous deployment Branch filter.

    enter image description here

    In this case, the build triggered by the release branch will trigger the corresponding release.

    enter image description here

    These settings also ensure that the changes you make in the release branch can trigger CI and CD automatically.

    Note: Github branches filters are case sensitive in Azure Devops.