如何自定义 CruiseControl.NET (CCNet) 仪表板?
我是 CCNet 新手...
我想自定义 CCNet Web 仪表板,在“强制构建”按钮旁边添加一个复选框,以指示特定构建是否要发布。
请让我知道这种定制是否可行?如果是这样,请提供一些教程或文章链接来开始
I'm new to CCNet...
I would like to customize CCNet web dashboard to add a checkbox next to "Force Build" button to indicate that particular build is for release or not.
Please let me know whether these kind of customization possible? If so, provide some tutorials or article links to start
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我认为做你想做的事情将是一个巨大的痛苦,因为你必须隐藏一些 CC.net 项目(比如说调试项目),并且如果选中该复选框,仍然构建它们。访问包含历史记录和日志的项目页面会很尴尬。如果您考虑动态编辑 ccnet 项目配置,请不要忘记您必须重新启动服务才能使其保持最新状态。最后,您的修改对于仪表板可能没问题,但会导致 cctray 出现问题。
相反,我要做的是拥有两个不同的项目,一个在调试模式下构建,一个在发布模式下构建。这会更加容易和直接。例如,您可能有一个调试项目,其构建是从源代码控制存储库更新触发的,而发布项目是手动或每晚构建的。
编辑
对于两个不同的项目,我要做的是使用公共代码(用于发布和调试)和两个动态参数(比如说 Conf 和 OutPath)组成一个块。我还将编写第三个项目来负责执行数据库脚本,该第三个项目将在发布版本的每次成功构建时触发。像这样继续将允许您单独执行调试/发布构建,单独执行脚本(在强制构建上)和在每个发布构建上,最后验证脚本(在每次提交上)。它看起来像这样:
I think doing what you wnat would be a huge pain, because you would have to hide some CC.net projects (let's say, the debug ones) and still build them if the checkbox is checked. That would be awkward to access the project's page with history and logs. If you thought about editing the ccnet project configuration on the fly don't forget you would have to restart the service to get it up-to-date. Finally your modifications could be ok for the dashboard but it will cause problem with cctray.
What I would do instead is having two distinct projects, one building in debug mode and one in release. This would be a lot more easy and straightforward. For example you could have a debug project whose builds are triggered from the source control repository updates and a release one which is manually or nightly built.
EDIT
For two different projects, what I would do is a bloc with the common code (for Release and Debug) with two dynamic parameters (let's say Conf and OutPath). I would also write a third project which takes care of executing the db script, this third project would be triggered every successful build of the Release one. Proceeding like this will allow you to execute Debug/Release builds separately, executing the script separately (on a force build) and on every Release build, and finally validating the script (on every commit). It would look like this :