olamy commented on code in PR #1213: URL: https://github.com/apache/maven/pull/1213#discussion_r1282671895
########## Jenkinsfile.s390x: ########## @@ -171,3 +171,74 @@ def archiveDirs(stageId, archives) { } } } + +def notify_s390x() { + echo "Build result: ${currentBuild.currentResult}" + // determine the message details + def providers + def messageBody + def messageTail = '' + def messageSubject + def sendMail + switch(currentBuild.currentResult) { + case "SUCCESS": + providers = [] + messageSubject = "Build succeeded in Jenkins: ${currentBuild.fullDisplayName}" + messageBody = """See ${currentBuild.absoluteUrl}""" + // only send successfuly builds if the previous build was unsuccessful or incomplete + sendMail = currentBuild.previousBuild == null || !"SUCCESS".equals(currentBuild.previousBuild.result) + break + case "UNSTABLE": + providers = [[$class: 'CulpritsRecipientProvider']] + messageSubject = "Build unstable in Jenkins: ${currentBuild.fullDisplayName}" + messageBody = """See ${currentBuild.absoluteUrl}""" + sendMail = true + messageTail = '\nBuild log:\n${BUILD_LOG}' + break + case "FAILURE": + providers = [[$class: 'CulpritsRecipientProvider']] + messageSubject = "Build failed in Jenkins: ${currentBuild.fullDisplayName}" + messageBody = """See ${currentBuild.absoluteUrl}""" + sendMail = true + messageTail = '\nBuild log:\n${BUILD_LOG}' + break + case "ABORTED": + providers = [[$class: 'CulpritsRecipientProvider']] + messageSubject = "Build aborted in Jenkins: ${currentBuild.fullDisplayName}" + messageBody = """See ${currentBuild.absoluteUrl}""" + sendMail = true + messageTail = '\nBuild log:\n${BUILD_LOG}' + break + default: + echo "Unknown status: ${currentBuild.currentResult}" + // should never happen if we are actually being invoked. + return + } + + // add the changes to the email + def authors = [] + if (currentBuild.changeSets.isEmpty() ) { + messageBody = messageBody + "\n\nNo changes.\n"; + } else { + messageBody = messageBody + "\n\nChanges:\n"; + for (def changeSet in currentBuild.changeSets) { + for (def change in changeSet) { + messageBody = messageBody + "\n* ${change.msg.trim().replaceAll('\n','\n ')}" + authors += change.author.id + } + } + messageBody = messageBody + "\n" + } + println("The authors of changes ${authors.unique()}.") + for (def author in authors) { + if (author.matches('(.*)github(.*)')) sendMail = false + } + + if (authors.isEmpty()) sendMail = false + + if (sendMail) { + messageBody = messageBody + '\n${FAILED_TESTS}\n' + messageTail + println("Sending email ...") + emailext body: messageBody, replyTo: 'd...@maven.apache.org', subject: messageSubject, to: 'ri...@ca.ibm.com' Review Comment: can you change the `replyTo` ? -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@maven.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org