如何在多个 CruiseControl.NET 版本之间共享标签值?
我在 CruiseControl.NET 中设置了两个项目:CI 构建和夜间构建。
它们都执行相同的 NAnt 脚本,但参数不同。
CruiseControl.NET 标签(当前由 DefaultLabeler 生成)作为版本的构建部分嵌入到 AssemblyInfo 中(例如,MajorVersion.MinorVersion.CCNET_Label.SVN_Revision)。
为了获得更一致的版本控制,我希望两个项目共享相同的 CruiseControl.NET 标签值。
我研究了作为 CruiseControl.NET 安装的一部分提供的贴标机,但我找不到能够满足我要求的贴标机。
如何在多个 CruiseControl.NET 版本之间共享标签值?
如果有更好的方法来做到这一点,我想知道。
我找到了办法。请参阅下面我的回答。
I have two projects set up in CruiseControl.NET: CI build and nightly build.
Both of them execute the same NAnt script, but with different parameters.
The CruiseControl.NET label (currently generated by the DefaultLabeler) is embedded into AssemblyInfo as the build part of the version (for example, MajorVersion.MinorVersion.CCNET_Label.SVN_Revision).
For more consistent versioning I would like both projects to share the same CruiseControl.NET label value.
I have investigated the labelers that are available as part of the CruiseControl.NET installation, but I could not find one that does what I want.
How do I share a label value between multiple CruiseControl.NET builds?
If there is a better way to do this, I would like to know.
I found a way. See my answer below.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我找不到满足我需要的现有解决方案,因此我最终编写了一个自定义 CruiseControl.NET 贴标机。
操作方法如下:
属性并将“程序集名称”更改为 *ccnet。<在此处插入名称>.CruiseControl.plugin*
I could not find an existing solution that to do what I needed, so I ended up writing a custom CruiseControl.NET labeller.
Here's how it is done:
properties and change "Assembly name" to *ccnet.<insert name here>.CruiseControl.plugin*
我遇到了同样的问题,但我发现将
与
结合使用被证明是一个更简单的解决方案。使用 stateFileLabeller 的唯一问题是您无法为项目中的状态文件指定目录,因为 CruiseControl.NET 找不到它。我把它留在默认目录中,效果很好。
I ran into the same issue, but I found that using the
<stateFileLabeller>
in conjunction with the<assemblyVersionLabeller>
proved to be a much simpler solution.The only gotcha about using the stateFileLabeller is that you can't specify a directory for your state files in a project, because CruiseControl.NET won't find it. I left it in the default directory, and it works great.
我修改了 Arnold 类,使其更像是默认标签器的复制品:
好处应该是您现在可以指定前缀以及“incrementonfailure”。此外,我还添加了一个“增量”属性,可用于根本不应该增加构建号的部署构建。如果你想自己修改它,我建议你看看他们的实现:
包含贴标器的 CruiseControl.NET 存储库文件夹
I've modified the class Arnold made making it more of a replica of the defaultlabeller:
The benefit should be that you now can specify prefix as well as "incrementonfailure". Also I've added a "increment" property that can be used for deployment builds that should not increment the build number at all. If you want to modify it yourself I would advise to have a look at their implementations:
CruiseControl.NET repository folder containing labellers