Vipin
Vipin

Reputation: 938

Git flow guideline for CI and CD

I would like to Integrate CI and CD with VSTS. I was going through the different link but getting confused, what process to follow. Attached git flow imageenter image description here

In this flow .

  1. The integration release will happen from develop branch?
  2. UAT release will happened from which branch? is it from master?
  3. Production Release should happened from master?
  4. If i need to integrate sonar or any static analysis tool which branch i need to integrate.

Please suggest me what should be the best git flow i can use in this case. I'm also attaching our current git flow. enter image description here

Upvotes: 1

Views: 3645

Answers (1)

Marina Liu
Marina Liu

Reputation: 38136

The functions of the main branches as below:

  • develop branch is for all developers to manage their works.
  • master branch is the main branch to manage the production versions.
  • release branches are the branches for preparing a new release (if UAT is necessary for your situation).

For the git flow with the branching model which you attached as below:

  • All the developers works on develop branch, and they can develop new features on theirs own feature branches. After finishing the work on feature branches, they should merge into develop branch.
  • If UAT is necessary for your git flow, you should create release branches for each new releases. Such as when you prepare to release the version for 1.0, you can create a release branch release-1.0 for UAT. And when it's ready, merge the release branch release-1.0 into master branch for the new production version.
  • For a release, if it's unnecessary to do UAT, then merge develop into master branch for a new release directly.

More details about the git flow explanation, you can refer the post A successful Git branching model.

So for your questions:

  1. The CI build should be based on your requirements. And it's also ok to set CI buils both for develop branch and master branch.
  2. UAT happens on release branches. When it's passed, then merge the release branches into master branch.
  3. Yes, production release happens on master branch.
  4. The analysis should be excuted in your CI build (in the same branch(es) triggered by CI build(s)).

Upvotes: 1

Related Questions