Created
April 6, 2017 06:22
-
-
Save rbjorklin/0c53ff38796df2f1577699b572809776 to your computer and use it in GitHub Desktop.
Jenkinsfile without mailing on ABORTED status
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
post { | |
failure { | |
echo "${currentBuild.currentResult}" // Always contains FAILURE | |
script { | |
try { | |
exec = currentBuild.rawBuild.getOneOffExecutor() | |
result = exec.abortResult().toString() | |
} catch (e) { | |
echo "${e.message}" // "Scripts not permitted to use method hudson.model.Executor abortResult" | |
} | |
if (result != 'ABORTED') { | |
emailext subject: "test", | |
body: "test", | |
recipientProviders: [[$class: 'FirstFailingBuildSuspectsRecipientProvider'], [$class: 'FailingTestSuspectsRecipientProvider'], [$class: 'CulpritsRecipientProvider']] | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment