Skip to content

Commit

Permalink
Merge pull request #765 from eclipse-lsp4j/cd_matrix
Browse files Browse the repository at this point in the history
added matrix notification to build
  • Loading branch information
cdietrich authored Sep 5, 2023
2 parents a687a1e + 7753428 commit c65a493
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions releng/build.Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -84,5 +84,38 @@ pipeline {
junit '**/build/test-results/test/*.xml'
archiveArtifacts '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: '!OVFCkkbjNkALzklVdr:matrix.eclipse.org',
body: "${lastResult} => ${curResult} ${env.BUILD_URL} | ${env.JOB_NAME}#${env.BUILD_NUMBER}",
formattedBody: "<div><font color='${color}'>${lastResult} => ${curResult}</font> | <a href='${env.BUILD_URL}' target='_blank'>${env.JOB_NAME}#${env.BUILD_NUMBER}</a></div>"
}
}
}
}
}

0 comments on commit c65a493

Please sign in to comment.