Git 的门控签入/预测试提交? [英] Gated check-ins / pre-tested commits for Git?

查看:23
本文介绍了Git 的门控签入/预测试提交?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在考虑从 TFS(Team Foundation Server)迁移到 Git,但找不到与 TFS 对门控签入(也称为预测试或延迟提交)的支持相匹配的任何内容.

I'm looking at migrating from TFS (Team Foundation Server) to Git, but can't find anything matching TFS' support for gated check-ins (also called pre-tested or delayed commits).

Atlassian Bamboo 不支持门控签到.TeamCity 确实支持它(使用他们的术语延迟提交"),但不支持 Git.单独使用 Jenkins 或 Jenkins+Gerrit 有很大的缺点,并且与 TFS 中的门控签入功能不符.(缺点由 Jenkins 的创建者本人在此视频中解释:http://www.youtube.com/watch?v=LvCVw5gnAo0)

Atlassian Bamboo has no support for gated check-ins. TeamCity does support it ("delayed commits" using their terminology), but not for Git. Using Jenkins by itself or Jenkins+Gerrit has huge drawbacks and doesn't come close to the gated check-in functionality in TFS. (Drawbacks explained by the creator of Jenkins himself in this video: http://www.youtube.com/watch?v=LvCVw5gnAo0)

Git 非常流行(有充分的理由),那么人们是如何解决这个问题的呢?目前最好的解决方案是什么?

Git is very popular (for good reason), so how are people solving this problem? What is currently the best solution?

推荐答案

我们刚刚开始使用 git,并且已经使用工作流实现了预先测试的提交(我今天刚刚完成了测试).

We have just started using git and have implemented pretested commits using workflows (I finished testing this just today).

基本上每个开发人员都有一个他们有读/写访问权限的个人存储库.在我们的案例中,构建服务器 TeamCity 使用这些个人存储库进行构建,然后如果成功则将更改推送到绿色"存储库.开发人员没有对绿色"的写入权限,只有 TeamCity 构建代理可以写入,但开发人员从绿色"中提取常见更新.

basically each dev has a personal repository which they have read/write access. The build server TeamCity in our case, builds using these personal repositories, and then if successful pushes the changes to the 'green' repository. Devs have no write access to 'green', only TeamCity build agents can write to that, but devs pull common updates from 'green'.

因此,开发人员从绿色"中拉动,推向个人,TeamCity 从个人构建,推向绿色.

So dev pulls from 'green', pushes to personal, TeamCity builds from personal, pushes to green.

这篇博文展示了基本模型我们正在使用个人存储库的 GitHub 分叉(使用分叉意味着存储库的数量不会失控并最终花费更多,并且意味着开发人员可以管理个人构建,因为他们可以分叉然后创建团队城市建设工作以将他们的代码推送到绿色"):

This blog post shows the basic model we are using, with GitHub forks for the personal repositories (using forks means that the number of repositories doesn't get out of hand and end up costing more, and means that the developers can manage the personal builds, as they can fork and then create the team city build jobs to get their code pushed to 'green'):

这是在 TeamCity 中设置的更多工作,因为每个开发人员都必须拥有自己的构建配置.这实际上必须是 2 个配置,因为 TeamCity 似乎执行所有构建步骤(包括最后的推动绿色"步骤),即使之前的构建步骤失败(如测试 :)),这意味着我们必须有一个个人为开发人员构建,然后是另一个依赖于它的构建配置,假设构建成功,它只会执行推送.

This is more work to set up in TeamCity as each developer has to have their own build configuration. Which actually has to be 2 configurations as TeamCity seems to execute all build steps (including the final 'push to green' step) even if the previous build steps fail (like the tests :)), which meant that we had to have a personal build for the developer, then a another build config which was dependent on that, which would just do the push assuming the build worked.

这篇关于Git 的门控签入/预测试提交?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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