[英]How will I write a Jelly script for BUILD_LOG_REGEX in Jenkins/Hudson Email-Ext Plugin?
I am trying to write/modify a jelly script in Jenkins Email-Ext that returns the build log. 我正在尝试在Jenkins Email-Ext中编写/修改一个果冻脚本,该脚本会返回构建日志。 I am trying to filter the log with BUILD_LOG_REGEX for regular expressions. 我正在尝试使用BUILD_LOG_REGEX过滤日志以获取正则表达式。 Can someone give me a sample script or format for doing build_log_regex using jelly script template? 有人可以给我一个示例脚本或使用果冻脚本模板进行build_log_regex格式的格式吗? Thanks in advance. 提前致谢。
The ${BUILD_LOG_REGEX}
token is used in the Default Content section of email-ext and typically not inside of the Jelly script. ${BUILD_LOG_REGEX}
令牌在email-ext的“默认内容”部分中使用,通常不在Jelly脚本内部。 To use it, just change your Default Content to reference this token: 要使用它,只需更改默认内容以引用此令牌:
The developer of email-ext recommended switching from Jelly to Groovy since they have "more power, its easier to use and you can prototype stuff in the script console to some degree". email-ext的开发人员建议从Jelly切换到Groovy,因为它们“功能更强大,更易于使用,并且可以在某种程度上在脚本控制台中原型化内容”。
See https://wiki.jenkins-ci.org/display/JENKINS/Email-ext+plugin#Email-extplugin-Scriptcontent 参见https://wiki.jenkins-ci.org/display/JENKINS/Email-ext+plugin#Email-extplugin-Scriptcontent
You can then look at the source code for BuildLogRegexContent
class on how this token is implemented and write code to produce exactly what you want. 然后,您可以查看BuildLogRegexContent
类的源代码,以了解如何实现此令牌,并编写代码以生成所需的内容。
可以用作起点的默认模板位于
$JENKINS_HOME/plugins/email-ext/WEB-INF/classes/hudson/plugins/emailext/templates/html.jelly
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.