gunit
gunit

Reputation: 3979

With Git feature branch workflow, when do you update the master branch?

I'm fairly new to git and Jenkins. We want to use Jenkins and follow the feature-branch-workflow concept, which I believe is similar to the GitHub flow.

I'm aware that the master branch should always be what's currently deployed in production, but then when should the master branch be updated? It seems like there are two choices:

  1. BEFORE deploying to production: A pull request gets approved and the successful merge with master triggers the build, deployment to a staging environment, QA testing, and then someone pushes a button to deploy to production
  2. AFTER deploying to production: Something (e.g. a pull request) triggers the build, testing, etc, and the code gets successfully released to production - THEN master is updated

But in the case of going with option (1), if the tests aren't passing and the newly updated master won't get released into production, do you then just reset master before you go home for the day?

Upvotes: 3

Views: 640

Answers (1)

VonC
VonC

Reputation: 1324258

if the tests aren't passing and the newly updated master won't get released into production,

You can update an ephemeral QA/integration branch first, running the test, and update master if those test pass (and trigger the release into production)

"ephemeral" means: you create/reset the QA branch just for integrating the feature branches marked as being for the next release.
You can see an example of ephemeral branches in the git workflow.

Upvotes: 2

Related Questions