diff --git a/Jenkinsfile b/Jenkinsfile index a573229e..f99f1168 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -212,12 +212,15 @@ pipeline { post { success { sendEmail("Successful") + sendSlack("Successful", "good") } failure { sendEmail("Failed") + sendSlack("Failed", "danger") } unstable { sendEmail("Unstable") + sendSlack("Unstable", "warning") } } } @@ -274,3 +277,11 @@ def sendEmail(status) { subject: "Build $BUILD_NUMBER - " + status + " ($JOB_NAME)", body: "Modifiche:\n " + getChangeString() + "\n\n Verifica console output: $BUILD_URL/console" + "\n") } + +// Funzione x invio email +def sendSlack(status, colorCode) { + slackSend ( + color: colorCode, + message: "Build $BUILD_NUMBER - " + status + " ($JOB_NAME)" + ) +}