简体   繁体   中英

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. I am trying to filter the log with BUILD_LOG_REGEX for regular expressions. Can someone give me a sample script or format for doing build_log_regex using jelly script template? 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. 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".

See 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.

可以用作起点的默认模板位于

$JENKINS_HOME/plugins/email-ext/WEB-INF/classes/hudson/plugins/emailext/templates/html.jelly

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM