如何实现DEMO发布

发布于 2025-01-16 06:45:08 字数 430 浏览 0 评论 0 原文

我和我的团队正在使用 GitFlow 对我们的代码进行版本控制,但现在我们需要为 DEMO 创建第三个分支,以便能够

  • 从 DEMO 中的 DEVELOP 发布进行测试,然后在所有测试通过后从 DEMO 发布到 MASTER
  • 合并来自 DEMO 的修复DEVELOP
  • 将修补程序从 MASTER 合并到 DEMO 和 DEVELOP 同时,

这里是版本控制流程的草稿(我希望它有帮助):

在此处输入图像描述

我找不到 GitFlow 的解决方案,有什么建议吗?我们应该选择其他工具吗?

My team and I are using GitFlow to versioning our code, but now we need to have a third branch for DEMO to be able to

  • publish from DEVELOP in DEMO for testing and then from DEMO to MASTER when all tests are passed
  • merge a fix from DEMO to DEVELOP
  • merge a hotfix from MASTER into DEMO and DEVELOP at the same time

here is a draft of the versioning flow (I hope it helps):

enter image description here

I can't find a solution with GitFlow, any advice? Should we choose another tool?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

请叫√我孤独 2025-01-23 06:45:08

这个问题听起来像是部署过程的结果,而不是 Git 合并策略的结果。

GitFlow 中没有 demo 分支的概念,尽管听起来您本质上是在尝试使用 release 分支。值得注意的是,GitFlow 本身没有任何内容可以精确控制您部署任何分支的方式,并且是否使用 GitFlow 的选择应该独立于您的服务器架构。

听起来您正在寻找的是将 release 分支部署到独立的测试服务器,然后对其进行测试。一旦测试通过,您就可以将相同的提交(在release分支上)部署到生产服务器。这样您就不必担心特定于测试的单独分支。请注意,master 本身不应部署到生产环境中;它仅被视为对代码的最后一个已知稳定版本的“引用”。您应该在部署(并标记提交)后立即合并回 master ,以防将来需要恢复到目标版本。

下面显示的标准 Git 流程对此进行了说明:

GitFlow

为了更进一步,还有一个 DevOps 测试概念 shifting-left,其中 develop 分支本身是测试的对象,并且被认为本身是可发布的。这进一步简化了流程,选择这种方法有利有弊。评估后可能值得考虑。

This problem sounds like it has arisen as a result of deployment processes, not Git merging strategy.

There is no concept of a demo branch in GitFlow, though it sounds like you're essentially trying to make use of a release branch. It's worth noting that there is nothing in GitFlow itself to regulate exactly how you deploy any of your branches, and the choice of whether or not to use GitFlow should be made independent of your server architecture.

What it sounds like you're looking for is to deploy out a release branch to an independent testing server, then test against that. Once the tests pass, you can deploy the same commit (on the release branch) out to the production server. This way you don't need to worry about a separate branch specific to testing. Note that master itself should not be deployed to production; it is merely considered a 'reference' to the last known stable version of the code. You should be merging back to master straight after a deployment (and tagging the commit) in case you need to revert back to the target version in the future.

This is illustrated in the standard Git Flow shown below:

GitFlow

To take this a step further, there is also a DevOps testing concept of shifting-left, where the develop branch itself is what is tested against, and considered to be shippable in itself. This simplifies the process even further, and there are pros and cons to choosing such an approach. It may be worth considering after evaluation.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文