如何在 Cruisecontrol 的发布者中使用构建标签?

发布于 2024-10-04 11:26:49 字数 746 浏览 5 评论 0原文

我的 CruiseControl config.xml 文件中有此部分:

<publishers>
   <onsuccess>
        <artifactspublisher dest="artifacts/${project.name}" file="projects/${project.name}/fred"/>
        <execute command="hg -R hg-succeeded/${project.name} pull"/>
        <execute command="hg -R hg-succeeded/${project.name} tag -l build-${label} -r tip"/>
    </onsuccess>
</publishers>

我得到的标签看起来像 build-${label}${label} 部分没有像我期望的那样被构建标签替换。我期待类似 build.1 的内容出现在 ${label} 的位置。我怎样才能做到这一点?

我的项目中确实使用 标记配置了默认的 labelincrementer。

另外,CruiseControl 文档绝对是糟糕的。有没有更好的文档?

I have this section in my CruiseControl config.xml file:

<publishers>
   <onsuccess>
        <artifactspublisher dest="artifacts/${project.name}" file="projects/${project.name}/fred"/>
        <execute command="hg -R hg-succeeded/${project.name} pull"/>
        <execute command="hg -R hg-succeeded/${project.name} tag -l build-${label} -r tip"/>
    </onsuccess>
</publishers>

I'm getting tags that look like build-${label}. The ${label} part isn't being replaced by the build label like I expect. I'm expecting something like build.1 to show up in place of ${label}. How do I make this happen?

I do have the default labelincrementer configured with a <labelincrementer /> tag in my project.

Also, the CruiseControl documentation is absolutely awful. Is there better documentation anywhere?

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

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

发布评论

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

评论(2

£噩梦荏苒 2024-10-11 11:26:49

如果您想将 ${label} 替换为 SVN 修订号之类的内容,您可以构建一个标签增量器插件 - 请参阅 http://www.java2s.com/Open-Source/Java-Document/Build/例如 Cruisecontrol/net/sourceforge/cruisecontrol/labelincrementers/SVNLabelIncrementer.java.htm

它被内置到一个 jar 中,并放置在 CruiseControl\lib 目录中。

在您的 CC 配置中,您可以通过声明来定义此插件:

<project ...>
  <plugin name="labelincrementer" class="my.subclass.of.LabelIncrementer" />
  <labelincrementer />
  ...
</project>

您可以在 标记内添加您喜欢的任何属性;它们将通过 setXXX 方法注入到您的 LabelIncrementer 子类的实例中。

If you want to replace ${label} with something like a SVN revision number, you can build a label incrementer plugin - see http://www.java2s.com/Open-Source/Java-Document/Build/cruisecontrol/net/sourceforge/cruisecontrol/labelincrementers/SVNLabelIncrementer.java.htm for an example.

This is built into a jar, and placed in the CruiseControl\lib directory.

In your CC config, you'd define this plugin by declaring:

<project ...>
  <plugin name="labelincrementer" class="my.subclass.of.LabelIncrementer" />
  <labelincrementer />
  ...
</project>

You can add any attributes you like inside your <labelincrementer ... /> tag; they'll be injected into an instance of your LabelIncrementer subclass by setXXX methods.

百变从容 2024-10-11 11:26:49

好吧,没有人回答这个问题,所以我会把这个答案放在这里,这样我就可以在明天的某个时候选择它并失去赏金。 叹气

我的答案是使用Hudson,因为看起来CruiseControl真的已经失效了做任何有用的开发,并已转向主要从事我不感兴趣的 .NET 版本。尽管如果有人知道如何在 CruiseControl 中做到这一点,我仍然洗耳恭听。

Well, nobody has answered this, so I will put this answer here so I can select it sometime tomorrow and lose the bounty. sigh

My answer is to use Hudson, since it looks like CruiseControl has really fallen off doing any useful development and has switched to largely working on the .NET version which I have no interest in. Though if anyone knows how to do it in CruiseControl I'm still all ears.

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