diff --git a/jenkins/nightly-deploy/Jenkinsfile b/jenkins/nightly-deploy/Jenkinsfile index 40cea8071c3..aec7003b47b 100644 --- a/jenkins/nightly-deploy/Jenkinsfile +++ b/jenkins/nightly-deploy/Jenkinsfile @@ -44,5 +44,38 @@ pipeline { success { archiveArtifacts artifacts: 'build/**' } + cleanup { + script { + def curResult = currentBuild.currentResult + def lastResult = 'NEW' + if (currentBuild.previousBuild != null) { + lastResult = currentBuild.previousBuild.result + } + + if (curResult != 'SUCCESS' || lastResult != 'SUCCESS') { + def color = '' + switch (curResult) { + case 'SUCCESS': + color = '#00FF00' + break + case 'UNSTABLE': + color = '#FFFF00' + break + case 'FAILURE': + color = '#FF0000' + break + default: // e.g. ABORTED + color = '#666666' + } + + matrixSendMessage https: true, + hostname: 'matrix.eclipse.org', + accessTokenCredentialsId: "matrix-token", + roomId: '!zbliqcdqsggOFDCUoF:matrix.eclipse.org', + body: "${lastResult} => ${curResult} ${env.BUILD_URL} | ${env.JOB_NAME}#${env.BUILD_NUMBER}", + formattedBody: "
${lastResult} => ${curResult} | ${env.JOB_NAME}#${env.BUILD_NUMBER}
" + } + } + } } } \ No newline at end of file