Skip to content

Commit 85a172f

Browse files
committed
jobs: include hotfix name in Slack notifications
Otherwise, the Slack notifications look just like the regular ones for the official streams the hotfix build is based on. We noticed this when testing the hotfix workflow recently.
1 parent 62529b8 commit 85a172f

File tree

3 files changed

+15
-3
lines changed

3 files changed

+15
-3
lines changed

jobs/build-arch.Jenkinsfile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -393,7 +393,11 @@ lock(resource: "build-${params.STREAM}-${basearch}") {
393393
throw e
394394
} finally {
395395
def color
396-
def message = "[${params.STREAM}][${basearch}] <${env.BUILD_URL}|${env.BUILD_NUMBER}>"
396+
def stream = params.STREAM
397+
if (pipecfg.hotfix) {
398+
stream += "-${pipecfg.hotfix.name}"
399+
}
400+
def message = "[${stream}][${basearch}] <${env.BUILD_URL}|${env.BUILD_NUMBER}>"
397401

398402
if (currentBuild.result == 'SUCCESS') {
399403
if (!newBuildID) {

jobs/build.Jenkinsfile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -484,7 +484,11 @@ lock(resource: "build-${params.STREAM}") {
484484
throw e
485485
} finally {
486486
def color
487-
def message = "[${params.STREAM}][${basearch}] <${env.BUILD_URL}|${env.BUILD_NUMBER}>"
487+
def stream = params.STREAM
488+
if (pipecfg.hotfix) {
489+
stream += "-${pipecfg.hotfix.name}"
490+
}
491+
def message = "[${stream}][${basearch}] <${env.BUILD_URL}|${env.BUILD_NUMBER}>"
488492

489493
if (currentBuild.result == 'SUCCESS') {
490494
if (!newBuildID) {

jobs/release.Jenkinsfile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -378,5 +378,9 @@ lock(resource: "release-${params.STREAM}", extra: locks) {
378378
currentBuild.result = 'FAILURE'
379379
throw e
380380
} finally {
381-
pipeutils.trySlackSend(message: ":bullettrain_front: release <${env.BUILD_URL}|#${env.BUILD_NUMBER}> [${params.STREAM}][${basearches.join(' ')}] (${params.VERSION})")
381+
def stream = params.STREAM
382+
if (pipecfg.hotfix) {
383+
stream += "-${pipecfg.hotfix.name}"
384+
}
385+
pipeutils.trySlackSend(message: ":bullettrain_front: release <${env.BUILD_URL}|#${env.BUILD_NUMBER}> [${stream}][${basearches.join(' ')}] (${params.VERSION})")
382386
}}} // try-catch-finally, cosaPod and lock finish here

0 commit comments

Comments
 (0)