2
votes

Question for CI/CD people out there. I'm using VSTS to automate our CI/CD story. Within our code repo we're using git flow, which means code moves from feature branches into our develop branch. When preparing a release, a specific release branch is created and eventually the code is merged to master for the current release.

Now what I'm wondering is how to facilitate this in a release pipeline within VSTS. Specifically the difference in the develop and master branches in combination with a release. What I found is that a release starts with specific artifacts so is thereby also tied to the build/branch where those artifacts originate from. As I see it, that would mean that if we want to do a daily deployment from the development branch but a more manual timed deployment from the master branch to acceptance and production environment, we would need two release definitions?

I'm really looking for some best practices on this topic and things that other people have already found out how to best build this pipeline. I found this topic already, but that doesn't give me what I'm looking for: Setup GitFlow in VSTS - Best practices?

1
You won't need two branches. You can just queue a build on your master branch manually and then use that build to create a release. By default, your build definition will be configured for develop branch to make scheduled builds every day.Harshil Lodhi
@Harshil I don't follow. I see how I can queue a manual build but you also want to be able to keep track of a release, not just now but also in a few months time when issues come in for that specific release. So just issuing a build does fulfill that requirement in my perspective. Also in the second part of your comment you refer to develop branch, which would mean there actually are two branches? I'm confused :)Jasper

1 Answers

2
votes

There are multiple ways to facilitate git flow with VSTS CI/CD.

And below is a kind of way to achieve it in VSTS (two CI build definitions and two CD release definition).

  • CI build and CD deploy for develop branch: after new changes are pushed to develop branch, build will be triggered. Then you can deploy to your test environment by the changes from develop branch.
  • CI build and CD deploy for master branch: after new changes are merged into master, build will be triggered. After build, new release will be created to deploy the new changes to the environment(s). Besides, if you merge release branch into master branch via Pull Request, you can also add PR build validation before merging.