Add failed build action

This commit is contained in:
Dan Hawkins 2021-11-20 00:03:08 +00:00
commit 3b9ba8bfcd

View file

@ -129,7 +129,9 @@ def performSuccessfulBuildActions() {
def sendemails(emailtolist) {
def emailbody = """
Failed build: ${JOB_NAME} ${BUILD_DISPLAY_NAME} : ${BUILD_URL}
"""
Console output: ${BUILD_URL}/console
"""
for(emailto in emailtolist) {
mail(
@ -137,6 +139,7 @@ def sendemails(emailtolist) {
body: emailbody,
to: emailto
)
echo "Send email to: ${emailto}"
}
}
@ -153,7 +156,6 @@ def performFailedBuildActions() {
}
if (postbuildactions) {
def emailtolist = postbuildactions['Email']['To']
echo "emailtolist: ${emailtolist}"
if (emailtolist) {
sendemails(emailtolist)
}