使用提交后挂钩触发 Cruise Control.net 构建
我正在寻找一种从颠覆后提交挂钩触发 Cruise Control.net 构建的方法。
我希望这样可以在提交后直接启动构建。 我知道执行此操作的正常方法(轮询服务器),但当可以使用钩子完成时,似乎没有必要继续轮询服务器。
一种想法是调用仪表板的“强制构建”功能,但这将触发构建,即使所有修改都在主干路径树之外,因此没有进行任何需要构建的修改。
I'm looking for a way to trigger a Cruise Control.net build from a subversion post-commit hook.
I want this to in order start the build directly after an commit.
I know about the normal way of doing this (polling the server) but it seems unnecessary to keep polling the server when it can be done using a hook.
One thought would be to invoke the "Force Build" functionality of the dashboard but this will trigger a build even if all modifications is outside of the trunk path tree and therefore no modification have been made which warrant a build.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
过滤更改的问题正是 CC.NET 使用轮询机制的原因。 (事实上,在某些情况下,可能需要在构建中包含多个开发人员的新更改。)
“强制构建”功能是我能想到的实现此目的的唯一机制,但是如果您只想要从主干进行更改,这需要您的提交后挂钩执行相当于通过某些适当的过滤器设置进行管道传送的 svn 日志(可能是详细日志),然后仅在需要时触发“强制构建”。
The problem with filtering changes is exactly why CC.NET uses the polling mechanism. (That, and the fact that there may be some scenarios where it is desirable to include new changes from multiple developers in the build.)
The "Force build" functionality is the only mechanism I can think of to accomplish this, however if you only wanted changes from the trunk that would require your post-commit hook to perform the equivalent of an svn log (possibly a verbose log) piped through some appropriate filter setting, then trigger the "force build" only if needed.
您使用“强制构建”的想法可能会奏效。
我不明白您对主干路径树之外的修改的担忧?
您不能在提交后挂钩中检查这一点,并且仅在修改的文件位于 /trunk 下时才强制构建
您是否考虑过这样做的缺点?
您有 2 个变更集。
您提交变更集 1,构建开始,您提交变更集 2,并且必须等待构建/测试完成,然后另一个构建才开始构建/测试变更集 2。
Your idea of using the "Force Build" will probably work.
I don't understand your concern about modifications outside of the trunk path tree though?
Can't you check for this in the post-commit hook and only force a build if the modified file is under /trunk
Have you considered the downside to doing this?
You have 2 changesets.
You commit changeset 1, build starts, you commit changeset2 and have to wait for your build / test to complete before another build starts to build / test changeset 2.
我建议不要这样做,但如果你真的想这样做,我会从 URL 触发器。
URL 触发器监视任何 URL 的更改,因此您只需让提交后挂钩更新 html 文件即可。 或者,如果您使用的是 viewvc,您可以让它监视以下 url:
该 URL 将在每次提交到 SVN 后更新
I would recommend against doing this, but if you REALLY want to, I'd start with a URL trigger.
The URL trigger monitors any URL for changes, so you could just have your post commit hook update an html file. Alternatively, if you are using viewvc, you could have it monitor the following url:
That URL will get updated after every commit to SVN