使用CI Server时如何在多台计算机上开发代码
目前,我大部分时间都是在上下班的火车上用笔记本电脑完成很多工作。但它远不如我家里的主机那么好或容易。我的问题是如何保持文件同步。我使用 subversion,但也有一个在每次签入时重建的 CI 服务器。有一个问题 这里处理多台机器并表示使用源代码控制。但是如果有 CI 服务器怎么办,这会导致构建失败。
我的第一个想法(这似乎有点愚蠢)是使用两组源代码控制,或者对于相同的代码至少使用两个存储库。一种用于 CI 服务器,另一种用于在机器之间传输。不确定你是否可以使用 SVN 来做到这一点。刚刚在 Jeol 的博客之后查看了 Mercurial。不确定这是否能够工作,因为您仍然存在推送到中央存储库(CI 服务器从中提取数据)的问题。
我想关键是如何共享仍然有错误或无法编译的代码,以便您可以切换机器而不中断构建?
谢谢
I currently develop a lot of my work on my laptop while on train to and from work most days. But it is no way near as good or easy as my main machine at home. My issue is how to keep the files in sync. I use subversion but also have a CI Server that rebuilds on each check in. There is a question here that deals with multiple machines and says to use source control. But what if there is a CI server, this would lead to broken builds.
My first thought (which seems a bit daft) would be to use two sets of source control, or at least two repos for the same code. One for the CI server and one to transfer between machines. Not sure you can even do that with SVN. Was just looking at Mercurial after Jeol's blog. Not sure if this would be able to work as you still have the issue of pushing to central repo would be where the CI server pulls from.
I guess the crux is how do you share code that is still buggy or doesn't compile so you can switch machines, without braking the build?
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
实际上,您的多存储库想法是正确的,但 Subversion 本身并不支持此类事情。考虑使用所谓的 DVCS(分布式版本控制系统),例如 Git 或 Mercurial >,您可以在其中拥有多个存储库并轻松地在它们之间共享更改。
然后,您可以从台式机或笔记本电脑将更改推送到中央服务器,源代码控制系统将为您解决所有问题。尚未完成的更改可以在另一个分支上完成,因此,如果有一天早上在火车上您编写了一些好的代码和一些坏的代码,您可以将好的代码推送到 CI 服务器使用的存储库,而将坏的代码推送到 CI 服务器使用的存储库中。转到您的桌面开发机器,然后从您上次停下的地方继续。
You're actually on the right track with the multiple repository idea, but Subversion doesn't natively support this sort of thing. Look into using a so-called DVCS (Distributed Version Control System) such as Git or Mercurial, where you can have multiple repositories and easily share changes between them.
You can then push changes to the central server from either your desktop or your laptop machine, and your source control system will sort it all out for you. Changes that are not yet complete can be done on another branch, so if one morning on the train you write some good code and some bad code, you can push the good code up to the repository used by the CI server, and the bad code over to your desktop development machine, and carry on from the point you left off.
分支机构呢?在一个分支上开发,只有在完成一项开发后才重新集成?
What about branches? Develop on one branch and only reintegrate after you finished a piece of development?