From 86b46317c90e494eaf35fee713065921a08c112e Mon Sep 17 00:00:00 2001 From: Christian Dietrich Date: Tue, 20 Aug 2024 14:32:54 +0200 Subject: [PATCH] added matrix to nightly deploy. See #3166 Signed-off-by: Christian Dietrich --- jenkins/nightly-deploy/Jenkinsfile | 33 ++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) 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