预构建任务 - 删除 CruiseControl.NET 中的工作副本
我目前正在工作中建立持续集成环境。 我们使用 VisualSVN Server 和 CrusieControl.NET。 有时,构建会失败,症状是 CruiseControl.NET 工作副本中存在冲突。 我相信这是由于我设置 Visual Studio 解决方案的方式造成的。 希望我们在这个环境中运行的项目越多,我们对如何设置它们的理解就会越好,所以我不会质疑为什么在这个阶段会发生冲突。 为了修复构建,我删除了工作副本并强制进行新的构建 - 这每次都有效(当前)。 所以我的问题是:删除工作副本是持续集成构建过程的有效部分吗?我该如何处理?
我尝试过包括 MSTask 和从命令行调用删除在内的解决方案,但我没有任何运气。
抱歉这么啰嗦 - 干得好,这是测试版:)
I'm currently in the process of setting up a continuous integration environment at work. We are using VisualSVN Server and CrusieControl.NET. Occasionally a build will fail and a symptom is that there are conflicts in the CruiseControl.NET working copy. I believe this is due to the way I've setup the Visual Studio solutions. Hopefully the more projects we run in this environment the better our understanding of how to set them up will be so I'm not questioning why the conflicts happen at this stage. To fix the builds I delete the working copy and force a new build - this works every time (currently). So my questions are: is deleting the working copy a valid part of a continuous integration build process, and how do I go about it?
I've tried solutions including MSTask and calling delete from the command line but I'm not having any luck.
Sorry for being so wordy - good job this is a beta :)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
如果您查看 CC.NET 的 jira,则会签入一个补丁来实施CleanCopy for Subversion 完全可以满足您的需求,只需在源代码控制块中将 CleanCopy 设置为 true,就像 TFS 一样。
If you check out CC.NET's jira there is a patch checked in to implement CleanCopy for Subversion which does exactly what you want and just set CleanCopy equal to true inside your source control block just like with the TFS one.
@Brad Barker
Clean 意味着只清除构建产品。
删除工作副本也会删除其他所有内容(源文件和项目文件等)。
一般来说,如果您构建的机器可以在不执行完全删除的情况下运行,那就太好了,因为这复制了普通开发人员所做的事情。 它在更新期间发现的任何冲突都是对开发人员预期的早期警告。
@jamie
对于正式版本,是的,最好进行完全干净的检查。 所以我想这取决于构建的目的。
@Brad Barker
Clean means to just wipe out build products.
Deleting the working copy deletes everything else too (source and project files etc).
In general it's nice if you're build machine can operate without doing a full delete, as this replicates what a normal developer does. Any conflicts it finds during update are an early warning to what your developers can expect.
@jamie
For formal releases yes it's better to do a completely clean checkout. So I guess it depends on the purpose of the build.
对于任何构建过程来说,在进行任何重要构建之前进行“清理”是很常见的,通常也是一个很好的做法。 这可以防止以前构建中的任何“伪影”污染输出。
清理本质上是通过删除工作副本来执行的操作。
It is very common and generally a good practice for any build process to do a 'clean' before doing any significant build. This prevents any 'artifacts' from previous builds to taint the output.
A clean is essentially what you are doing by deleting the working copy.
@jamie:在使用持续集成服务器时,您可能无法每次都进行干净的构建,原因之一是构建时间。 在我参与过的一些项目中,干净的构建需要 80 多分钟(一个嵌入式项目由数千个 C++ 文件组成,需要签出然后针对多个目标进行编译)。 在这种情况下,您必须权衡快速反馈的好处与干净构建捕获增量构建无法捕获的东西的可能性。 在我们的案例中,我们致力于改进和并行化构建过程,同时允许在我们的 CI 机器上进行增量构建。 我们确实遇到了一些问题,因为我们没有进行干净的构建,但是通过每晚或每周进行一次干净的构建,您可以消除风险,而不会失去 CI 机器的快速反馈。
@jamie: There is one reason why you may not be able to do a clean build every time when using a continuous integration server -- build time. On some projects I've worked on, clean builds take 80+ minutes (an embedded project consisting of thousands of C++ files to checkout and then compile against multiple targets). In this case, you have to weigh the benefit of fast feedback against the likelihood that a clean build will catch something that an incremental build won't. In our case, we worked on improving and parallelizing the build process while at the same time allowing incremental builds on our CI machine. We did have a few problems because we weren't doing clean builds, but by doing a clean build nightly or weekly you could remove the risk without losing the fast feedback of your CI machine.
在构建之前或之后进行完全删除是一个很好的做法。 这意味着您的构建环境不可能拾取过时的文件。 您的构建完全根据存储库中的内容进行。
删除工作副本是可能的,就像我用 Nant 所做的那样。
在 Nant 中,我会在自己的文件夹中放置一个干净的脚本,而不是我想要删除的脚本,然后从 CC.net 调用它。
我认为这也可以通过批处理文件实现。 看一下 rmdir 命令 http://www.computerhope.com/rmdirhlp.htm
@ pauldoo
我更喜欢我的 CI 服务器进行完全删除,因为当我进行发布构建时我不希望有任何意外,而发布构建应该始终在干净的状态下完成。 但它应该能够处理两者,没有理由不
Doing a full delete before or after your build is good practice. This means that there is no chance of your build environment picking up an out of date file. Your building exactly against what is in the repository.
Deleting the working copy is possible as I have done it with Nant.
In Nant I would have a clean script in its own folder outwith the one I want to delete and would then invoke it from CC.net.
I assume this should also be possible with a batch file. Take a look at the rmdir command http://www.computerhope.com/rmdirhlp.htm
@pauldoo
I prefer my CI server to do a full delete as I don't want any surprise when I go to do a release build, which should always be done from a clean state. But it should be able to handle both, no reason why not