Skip to content

Commit 4357f1a

Browse files
committed
Include failure logs.
1 parent bb088eb commit 4357f1a

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

.jenkins/Jenkinsfile

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ pipeline {
3030
stage("Pre-flight") {
3131
steps {
3232
script {
33-
SLACK_THREAD = slackSend(color: '#0063D1', channel: '#sds-ci', message: "🚀 *${PROJECT}* `${VER}` on `${BRANCH_NAME}` — build #${BUILD_NUMBER} has begun systems check\nCountdown initiated. Manage your expectations.\n<${BUILD_URL}|Watch nervously>").threadId
33+
def slackResponse = slackSend(color: '#0063D1', channel: '#sds-ci', message: "🚀 *${PROJECT}* `${VER}` on `${BRANCH_NAME}` — build #${BUILD_NUMBER} has begun systems check\nCountdown initiated. Manage your expectations.\n<${BUILD_URL}|Watch nervously>")
34+
SLACK_THREAD = slackResponse?.threadId ?: '#sds-ci'
3435
sh "conan graph info -s:h build_type=Debug ${CONAN_FLAGS} ."
3536
sh "conan graph info -s:h build_type=RelWithDebInfo -o sisl/*:malloc_impl=tcmalloc ${CONAN_FLAGS} ."
3637
}
@@ -66,7 +67,12 @@ pipeline {
6667

6768
post {
6869
failure {
69-
slackSend color: '#E43237', channel: "${SLACK_THREAD}", replyBroadcast: true, message: "💀 *${PROJECT}* `${VER}` (`${BRANCH_NAME}`) build #${BUILD_NUMBER} didn't make it\nHeld on for _${currentBuild.durationString}_ before calling it quits\n<${BUILD_URL}|Post-mortem>\n🪦"
70+
script {
71+
def log = currentBuild.rawBuild.getLog(25)
72+
.collect { it.replaceAll(/\x1B\[[0-9;]*[a-zA-Z]/, '') }
73+
.join('\n')
74+
slackSend color: '#E43237', channel: "${SLACK_THREAD}", replyBroadcast: true, message: "💀 *${PROJECT}* `${VER}` (`${BRANCH_NAME}`) build #${BUILD_NUMBER} didn't make it\nHeld on for _${currentBuild.durationString}_ before calling it quits\n<${BUILD_URL}|Post-mortem>\n🪦\n\`\`\`${log}\`\`\`"
75+
}
7076
}
7177
success {
7278
slackSend color: '#85B717', channel: "${SLACK_THREAD}", replyBroadcast: true, message: "✅ *${PROJECT}* `${VER}` (`${BRANCH_NAME}`) build #${BUILD_NUMBER} — it actually worked\nDebug + RelWithDebInfo both green in _${currentBuild.durationString}_\n<${BUILD_URL}|Full report>\n🍾 Mission successful!"

0 commit comments

Comments
 (0)