借助Git功能分支工作流程,您何时更新主分支? [英] With Git feature branch workflow, when do you update the master branch?

查看:154
本文介绍了借助Git功能分支工作流程,您何时更新主分支?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对git和詹金斯相当陌生。我们希望使用Jenkins并遵循功能分支工作流程概念,我相信它类似于 GitHub流程



我知道主分支应该始终是生产中当前部署的东西,但是何时应该更新主分支?看起来有两种选择:


  1. 在部署到生产之前:拉取请求获得批准,并且与主成功合并触发构建,部署到暂存
    环境,进行QA测试,然后有人按下一个按钮以将
    部署到生产中

  2. 部署到生产后:某些内容(例如拉取请求)触发构建,测试等,并且代码成功发布到生产环境 - THEN master已更新

但是,与选项(1),如果测试没有通过,并且新更新的主人将不会被释放到生产中,那么您是否在您回家前一天重置主人?

如果测试未通过并且新更新的主控程序不会发布到产品中,那么

您可以先更新一个短暂的 QA /整合分支,runnin如果这些测试通过(并触发释放到生产中),则更新主设备。

ephemeral 表示:您创建/重置QA分支仅用于集成标记为下一个版本的功能分支。

您可以看到一个示例在git工作流程中的短暂分支


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?

解决方案

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.

这篇关于借助Git功能分支工作流程,您何时更新主分支?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆