I am trying to email the console o/p in HTML format using pipeline script. However, it doesn't seem to be working. Any suggestions.
def notifySuccessful() {
emailext (
subject: "STARTED: Job ${env.JOB_NAME} [${env.BUILD_NUMBER}]",
body: '<pre>${BUILD_LOG_EXCERPT, start="^Hello World", end="^Finished: SUCCESS"} </pre>',
to: 'myemail.com'
)
}
When I run this, I get the email with the below text in the body
${BUILD_LOG_EXCERPT, start="^Hello World", end="^Finished: SUCCESS"} .
I tried with putting ''' or """" or ' to the line
${BUILD_LOG_EXCERPT, start="^Hello World", end="^Finished: SUCCESS"}
but that doesn't work either. If I enclosed with a single ", I get an error that says
unexpected token BUILD_LOG_EXCERPT


${BUILD_LOG_EXCERPT, start="^Hello World", end="^Finished: SUCCESS"}in the o/p but not in html converted format – Bond Dec 02 '17 at 00:00