源代码控制构建分支

发布于 2024-07-15 07:30:48 字数 457 浏览 10 评论 0原文

我目前正在评估不同的源代码控制解决方案以供工作,并且有一些关于分支的问题。

我对如何分支有基本的了解,但我不确定我们的构建机器(CruiseControl.net)如何获得分支来构建它。

我们有很多项目,这些项目都被其他项目所依赖(还有其他项目): 公用事业> 数据访问> 业务逻辑> 通用GUI> (网站 | 桌面客户端)

我们如何构建存储库(Vault,如果这有什么区别),以便构建机器能够:

  1. 构建主干
  2. 构建“最新”分支

粗略的文件夹结构和/或者解释一下如何从 Cruisecontrol 获取信息会很棒。

谢谢

编辑:

为了增加一些清晰度,我们打算使用主干进行开发,然后为每个版本使用一个分支。

I am currently evaluating different source control solutions for work, and have a few questions about branching.

I have the basic understanding of how to branch, but i am unsure of how our build machine (CruiseControl.net) can get a branch to build it.

We have many projects, which are all relied appon by other projects (there are others to):
Utilities > Data Access > Business Logic > Common GUI > ( Website | Desktop clients )

How do we structure the repository (Vault if that makes any difference) so that the build machine is able to:

  1. Build the trunk
  2. Build the 'latest' branch

A rough folder structure and/or an explanation on how to get from cruisecontrol would be great.

thanks

Edit:

To add some clarity, we intend to use the trunk for development, and then use a branch for each release.

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

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

发布评论

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

评论(3

夜巴黎 2024-07-22 07:30:48

如果项目具有不同的发布周期(项目 1 的版本是 1.0,而项目 2 的版本已经是 1.1),Mark 提出的解决方案效果很好。 如果您的所有项目都是相互依赖的,我会从一个简单的结构开始,

My Big Project
  | 
  +-- trunk
  |     |
  |     +-- utils
  |     |
  |     +-- data
  |     |
  |     +-- business
  |     |
  |     +-- gui (web)
  |     |
  |     +-- gui (swing)
  | 
  +-- branches
  | 
  +-- tags

这样,您确定在执行分支/标记时已经分支了所有内容(整个代码)。 否则,您在标记时总会面临错过一个项目的风险。

您的构建服务器只需检查主干(包含所有内容)或一个标签/分支(也包含所有内容)并构建/安装该版本。

一旦 utils 包稳定,您可以随时将其“升级”到同级项目并使用 Maven/Ivy 来管理依赖关系。

The solution proposed by Mark works well if the projects have different release cycles (Project 1 has version 1.0 while Project 2 is already at 1.1). If all your projects are inter-dependants, I would start with a simple structure

My Big Project
  | 
  +-- trunk
  |     |
  |     +-- utils
  |     |
  |     +-- data
  |     |
  |     +-- business
  |     |
  |     +-- gui (web)
  |     |
  |     +-- gui (swing)
  | 
  +-- branches
  | 
  +-- tags

That way, you're sure you have branched everything (the whole code) when you do a branch/tag. Otherwise, you always risk to miss one project when tagging.

Your build server would simply check out the trunk (with everything) or one tag/branch (also with everything) and build/install the release.

Once the utils package is stable, you can always "upgrade" it to a sibling project and use Maven/Ivy to manage the dependency.

水中月 2024-07-22 07:30:48

“最新分支”是什么意思? 分支应用于主干之外的扩展开发 - 主干应始终包含最新的生产代码。

每个项目都应该有 trunkbranches 文件夹:

Project 1
  |-> trunk
  |-> branches
Project 2
  |-> trunk
  |-> branches
    etc.

然后,您的构建机器可以在本地将任何主干或分支检出到它想要的任何地方(对于您的互连项目,您必须将其设置为以便相对目录路径起作用)。 在伪脚本中:

checkout project1/trunk /builds/project1
build /builds/project1

checkout project1/branches/myBranch /builds/project1
build /builds/project1

What do you mean by 'latest branch'? Branches should be used for extended devlopment outside of trunk - the trunk should always contain the latest production code.

Each project should have trunk and branches folders:

Project 1
  |-> trunk
  |-> branches
Project 2
  |-> trunk
  |-> branches
    etc.

Your build machine can then checkout any trunk or branch locally to wherever it wants (for your interlinking projects you'll have to set it up so that the relative directory paths work). In pseudoscript:

checkout project1/trunk /builds/project1
build /builds/project1

and

checkout project1/branches/myBranch /builds/project1
build /builds/project1
我的痛♀有谁懂 2024-07-22 07:30:48

只是为了澄清弗拉基米尔的方案中如何使用标签和分支。 假设您的产品的 1.x 版已退役,2.1 版已推出,而您正在开发 3.0 版:

trunk <- you're working on version 3.0 here
 project1
 project2

branches
 ReleaseBranch-1.0
 ReleaseBranch-2.0 <-- fixes to version 2.1 (the current production version) get committed here, then merged into the trunk

tags
 Release-1.0 <-- a copy of the source that was used to build version 1.0
 Release-1.1
 Release-1.2
 Release-2.0
 Release-2.1

在您的持续集成/构建服务器中,您将需要 2 个进程:

  • 一个指向到版本控制系统中的主干,
  • 该主干指向版本控制系统上的 ReleaseBranch-2.0

这本书 使用 Subversion 进行实用版本控制 是为 Subversion 设计的,但确实介绍了如何组织存储库,如上所述。

Just to clarify about how tags and branches would be used in Vladimir's scheme. Let's say that version 1.x of your product is retired, version 2.1 is out in the world, and you're working on version 3.0:

trunk <- you're working on version 3.0 here
 project1
 project2

branches
 ReleaseBranch-1.0
 ReleaseBranch-2.0 <-- fixes to version 2.1 (the current production version) get committed here, then merged into the trunk

tags
 Release-1.0 <-- a copy of the source that was used to build version 1.0
 Release-1.1
 Release-1.2
 Release-2.0
 Release-2.1

In your continuous integration/build server, you're going to need 2 processes:

  • one that points to the trunk in your version control system
  • one that points to ReleaseBranch-2.0 on your version control system

The book Pragmatic Version Control with Subversion is designed for Subversion, but does go into how to organize a repository as described above.

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