CruiseControl:如何从执行任务读取日志
我通过 Cruisecontrol 启动了一个外部 groovy 脚本,它基本上可以工作。我的问题是,如果 groovy 脚本失败,我只会在我的 Cruise Web 应用程序和电子邮件中收到“找到错误字符串”;它甚至不在日志文件中。 groovy 脚本将其输出写入 stdout 并 写入日志文件。如何在 Cruisecontrol 日志中显示外部脚本的输出?
<project name="proj">
<schedule>
<exec workingdir="/myscripts/folder"
command="//bin/groovy"
args="build.groovy -p ${project.name}.properties"
errorstr="Exception"/>
</schedule>
</project>
I start an external groovy script via cruisecontrol, which basically works. My problem is that if the groovy script fails I only get the "error string found" in my cruise webapp and email; its even not in the log files. The groovy script writes it output to stdout and to a logfile. How it is possible to display the output of an external script in the cruisecontrol logs?
<project name="proj">
<schedule>
<exec workingdir="/myscripts/folder"
command="//bin/groovy"
args="build.groovy -p ${project.name}.properties"
errorstr="Exception"/>
</schedule>
</project>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
在构建日志中包含某些内容的一种方法是使用< /code> 元素
。
我不确定这是否是您正在寻找的。但是
元素会获取一些文件并将其放入(合并)到构建日志中。A way to include something in the build log is to use
<merge>
element.I am not sure if this is what you are looking for. But
<merge>
element takes some file and puts it (merges it into) to the build log.我们有同样的问题。问题出在 exec 插件本身。我们对其进行了修补以满足我们的需求并正确解析我们工具的输出。
你应该去这里:
http://www.java2s.com/Open-Source/Java-Document/Build/cruisecontrol/net/sourceforge/cruisecontrol/builders/ExecBuilder.java.htm
了解它的工作原理并对其进行修补。然后您需要使用现在修补的插件重新编译 Cruisecontrol.jar。不幸的是,cruisecontrol 不再维护,正如您将看到的 exec 插件也是一个自定义插件。
希望有帮助。
We had the same problem. The problem is in the exec plugin itself. We patched it to suit our needs and to correctly parse the output of our tools.
You should go here :
http://www.java2s.com/Open-Source/Java-Document/Build/cruisecontrol/net/sourceforge/cruisecontrol/builders/ExecBuilder.java.htm
Understand how it works and patch it. Then you will need to recompile cruisecontrol.jar with your now patched plugin. Unfortunately cruisecontrol is not maintened any more and as you will see the exec plugin is also a custom plugin.
Hope it helped.