Thursday, 19 April 2012

Using BUILD_LOG_REGEX in jenkins email notification

Jenkins provide 'Email-ext' plugin, which allows to configure every aspect of email notifications.
One of my requirement is to send in mail the build package URL, which is already getting displayed in console output.

I found a token 
${BUILD_LOG_REGEX, regex, linesBefore, linesAfter, maxMatches, showTruncatedLines, substText, escapeHtml, matchedLineHtmlStyle} - Displays lines from the build log that match the regular expression. 

Here is example usage of it
${BUILD_LOG_REGEX, regex="^Build package URL:", showTruncatedLines=false}

This will extract the line starting with "Build package URL:" from the build log and send it through mail.

No comments:

Post a Comment