Use extended email to send emails on failed build
This commit is contained in:
parent
7b58c8c8dc
commit
b2a9f194a0
1 changed files with 18 additions and 33 deletions
|
|
@ -176,6 +176,9 @@ def getRecipientProviders(recipientProviderInfo) {
|
|||
}
|
||||
}
|
||||
}
|
||||
if (recipientProviders.size() == 0) {
|
||||
recipientProviders = [culprits(), requestor(), developers(), upstreamDevelopers()]
|
||||
}
|
||||
echo "recipientProviders: ${recipientProviders.toString()}"
|
||||
return recipientProviders;
|
||||
}
|
||||
|
|
@ -194,39 +197,21 @@ def sendextemail(extmailinfo) {
|
|||
def recipientProviders = getRecipientProviders(extmailinfo['Recipient providers'])
|
||||
def toList = getToList(extmailinfo['To'])
|
||||
|
||||
if (toList.length() <= 0) {
|
||||
emailext(
|
||||
subject: "[Jenkins] Failed build: ${JOB_NAME} ${BUILD_DISPLAY_NAME}",
|
||||
body: '''${JELLY_SCRIPT,template="html"}''',
|
||||
attachLog: true,
|
||||
// attachmentsPattern: '',
|
||||
compressLog: false,
|
||||
// from : '',
|
||||
mimeType: 'text/html',
|
||||
// postsendScript: '',
|
||||
// presendScript: '',
|
||||
recipientProviders: recipientProviders, // Could be: buildUser, culprits, developers, brokenTestsSuspects, brokenBuildSuspects, recipients, requestor, upstreamDevelopers
|
||||
// replyTo: '',
|
||||
saveOutput: false,
|
||||
// to: toList,
|
||||
)
|
||||
} else {
|
||||
emailext(
|
||||
subject: "[Jenkins] Failed build: ${JOB_NAME} ${BUILD_DISPLAY_NAME}",
|
||||
body: '''${JELLY_SCRIPT,template="html"}''',
|
||||
attachLog: true,
|
||||
// attachmentsPattern: '',
|
||||
compressLog: false,
|
||||
// from : '',
|
||||
mimeType: 'text/html',
|
||||
// postsendScript: '',
|
||||
// presendScript: '',
|
||||
// recipientProviders: recipientProviders, // Could be: buildUser, culprits, developers, brokenTestsSuspects, brokenBuildSuspects, recipients, requestor, upstreamDevelopers
|
||||
// replyTo: '',
|
||||
saveOutput: false,
|
||||
to: toList,
|
||||
)
|
||||
}
|
||||
emailext(
|
||||
subject: "[Jenkins] Failed build: ${JOB_NAME} ${BUILD_DISPLAY_NAME}",
|
||||
body: '''${JELLY_SCRIPT,template="html"}''',
|
||||
attachLog: true,
|
||||
// attachmentsPattern: '',
|
||||
compressLog: false,
|
||||
// from : '',
|
||||
mimeType: 'text/html',
|
||||
// postsendScript: '',
|
||||
// presendScript: '',
|
||||
recipientProviders: recipientProviders, // Could be: buildUser, culprits, developers, brokenTestsSuspects, brokenBuildSuspects, recipients, requestor, upstreamDevelopers
|
||||
// replyTo: '',
|
||||
saveOutput: false,
|
||||
to: toList,
|
||||
)
|
||||
}
|
||||
|
||||
def performFailedBuildActions() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue