将 SVN 与 CruiseControl 结合使用?

发布于 2024-07-14 00:33:24 字数 850 浏览 6 评论 0 原文

我正在尝试使用 CruiseControl 2.7.3(原始版本)来构建 Java SVN 存储库中的项目。

我的巡航配置使用 svn 插件 进行修改集。 当检测到修改时,将使用 Ant 安排构建。 然后,该 Ant 构建文件使用 svnant Ant 任务对项目进行完整的签出。 有一段时间,我们将其设置为仅签出“HEAD”,但我们遇到过这样的情况:构建不会触发一两次签入,因为签入发生在修改集检查之后,但在 ant 调用之前svn结账。 因此,我们尝试更改 ant 构建文件以使用修改检查检索到的修订号。

CruiseControl 配置参考页面声称设置并传递了一个属性 svnrevision对于构建者来说,就像标签属性是由 labelincrementers 实现的一样。 当我按下强制构建按钮时,它似乎没有被设置。

我需要做些什么才能让这一切顺利进行吗?

I'm trying to use CruiseControl 2.7.3, (the original), to build a Java project that is in an SVN repository.

My cruise configuration is using the svn plugin for the modification set. When a modification is detected, a build is scheduled using Ant. That Ant build file then uses the svnant Ant Task to do a complete checkout of the project. For a while, we had this set to just checkout "HEAD", but we've had cases where the build won't fire for a check in or two because the checkin occurred after the modification set check, but before the ant call to svn checkout. As a result, we are trying to change the ant build file to use the revision number that the modification check retrieves.

The CruiseControl Configuration Reference page claims that a property, svnrevision, is set and passed to the builders, just like the label property is by the labelincrementers. It appears to not be set when I press the force build button.

Is there something I need to do to make this go?

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

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

发布评论

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

评论(3

他夏了夏天 2024-07-21 00:33:24

查看 SVN 源代码控制的代码,似乎 svnrevision 应该传递给构建器,从而传递给您的 Ant 调用。 您是否尝试过使用 Ant 脚本中的属性?

回答评论中的问题:

那是因为在强制构建的情况下没有修改,所以没有修改版本号。 在这种情况下, svnlabelincrementer 将传递您本地的最新版本号,这也将是最新的。

Looking at the code for the SVN source control it seems that svnrevision should be passed along to the builder, and thus along to your Ant invocation. Have you tried using the property from your Ant script?

In response to the question in the comment:

That's because in the force build case there was no modification, so there's no modification revision number. In that case the svnlabelincrementer will pass the latest revision number for what you have locally, which will also be the latest.

不爱素颜 2024-07-21 00:33:24

Cruisecontrol ant 调用与这样构造的 (svn) 标签无关。 svn 标签用于注释构建名称,而 build.log 实际上只是 ant 通过 Cruisecontrol 传递时的输出。

如果您希望将修订号写入 ant 构建输出,基本上有两种方法:

一种方法是让 ant 以某种方式与 svn 交互。 ant 中的 svn 只能通过 tigris 的 contrib ant 任务 获得,因此它不是放入你的 ant 文件中很简单。 但是在您的构建中,您可以执行 svn info 并获取修订号作为您可以使用的 ant 属性。

另一种方法是使用 svnlabelincrementer 将修订号分配给标签,并使用 。 正如 Jay 在评论中提到的,标签只包含最后一次成功的构建修订,这不是他想要的。 已在此博客上提出了修复方案,但执行以下操作在 ant 构建文件中工作似乎更合适。

The cruisecontrol ant invocation has nothing to do with the (svn)label that is contructed as such. The svn label is used to annotate the build-names whereas the build.log is really just the output from ant as it is passed through cruisecontrol.

If you would like to have the revision number written to the ant build output, there are basically two ways:

One way is to have ant interact with svn in some way. Svn in ant is only available through a contrib ant task from tigris, so it is not trivial to put into your ant file. But with this in your build, you could do a svn info and get the revision number as ant properties at your disposal.

Another way is to use the svnlabelincrementer to assign the revision number to the label, and pass that onto the ant script using the buildproperties that are passed from cruisecontrol to the build scripts. As Jay mentioned in the comments, the label contains only the last successfull build revision, which is not what he wants. A fix has been proposed on this blog, but doing the work in the ant build file seems more suitable.

执笔绘流年 2024-07-21 00:33:24

您可以使用安静期设置吗? 提交后,CruiseControl 可以等待一段时间(例如 30 秒),然后再开始构建。

它不会为每个提交触发单独的构建。 相反,大约在同一时间提交将启动单个构建。

Can you use the quietperiod setting? After a commit, CruiseControl can wait for some amount of time (say, 30 seconds) before kicking off a build.

It won't fire off individual builds for each commit. Rather, commits around the same time will kick off a single build.

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