How to have output of script emailed from Jenkins? How to have output of script emailed from Jenkins? jenkins jenkins

How to have output of script emailed from Jenkins?


To configure the Email-ext plugin:

To get a portion of the log in the mail, if not all, set the 'Extended E-mail Notification' to send an email for each build that failed, and use the $BUILD_LOG in the body of the message:

  1. In the body of the message (below the '$DEFAULT_CONTENT' ) add the parameter $BUILD_LOG to display the end of the build log
  2. Assuming the log is in plain-text, change 'Content Type' to Plain Text

For the list of built-in Jenkins parameters, go to this page:

  • http://[your-jenkins-server]/env-vars.html

Cheers

EDIT:

To get to that list of available env-vars via the UI,
there is a link at the Execute shell build-step, for example -

Link to Env-Vars list via the UI


I'm not sure if this is exactly what you're looking for, but the Email-ext plugin for Jenkins sounds like it may do what you want.