Skip to content
This repository has been archived by the owner on Sep 18, 2020. It is now read-only.

Commit

Permalink
Switch to new trySlackSend function
Browse files Browse the repository at this point in the history
Switch all slackSend calls to trySlackSend.   Fixes errors like these
when the Slack Notification Plugin is not configured:

      java.lang.NoSuchMethodError: No such DSL method 'slackSend' found

Signed-off-by: Geoff Levand <geoff@infradead.org>
  • Loading branch information
glevand committed Feb 13, 2018
1 parent 6b5b542 commit 3512452
Show file tree
Hide file tree
Showing 13 changed files with 14 additions and 24 deletions.
6 changes: 1 addition & 5 deletions os/board/sign-image.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -106,11 +106,7 @@ stage('Wait') {
def msg = """The ${params.BOARD} ${version ?: "UNKNOWN"} build is waiting for the boot loader files to be signed for Secure Boot and uploaded to continue.\n
When all boot loader files are uploaded, go to ${BUILD_URL}input and proceed with the build."""

try {
slackSend color: '#C0C0C0', message: msg
} catch (NoSuchMethodError err) {
echo msg
}
trySlackSend color: '#C0C0C0', message: msg
input 'Waiting for the signed UEFI binaries to be ready...'
}

Expand Down
2 changes: 1 addition & 1 deletion os/docs-sync.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ git -C coreos-pages push -f ${forkUrl} ${branch}
sourceBranch: branch,
title: "os: sync ${version}",
message: "From: ${env.BUILD_URL}"
slackSend color: '#2020C0',
trySlackSend color: '#2020C0',
message: "${version} (${channel}) docs: ${url}"
}
}
Expand Down
2 changes: 1 addition & 1 deletion os/glsa.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ exit 0 # Do not return a non-zero $? from above.
def color = readFile 'status.txt'
def message = readFile 'notify.txt'
if (message)
slackSend color: color ?: '#C0C0C0', message: """${message}
trySlackSend color: color ?: '#C0C0C0', message: """${message}
Run `update_ebuilds --commit --portage=rsync metadata/glsa` in the SDK to \
update GLSA definitions."""
}
Expand Down
2 changes: 1 addition & 1 deletion os/kola/aws.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -101,5 +101,5 @@ timeout --signal=SIGQUIT 120m bin/kola run \
currentBuild.result = rc == 0 ? 'SUCCESS' : 'FAILURE'

if (currentBuild.result == 'FAILURE')
slackSend color: 'danger',
trySlackSend color: 'danger',
message: "```Kola: AWS-amd64-$AWS_AMI_TYPE Failure: <${BUILD_URL}console|Console> - <${BUILD_URL}artifact/_kola_temp.tar.xz|_kola_temp>\n$message```"
2 changes: 1 addition & 1 deletion os/kola/do.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -147,5 +147,5 @@ timeout --signal=SIGQUIT 60m bin/kola run \
currentBuild.result = rc == 0 ? 'SUCCESS' : 'FAILURE'

if (currentBuild.result == 'FAILURE')
slackSend color: 'danger',
trySlackSend color: 'danger',
message: "```Kola: DO-amd64 Failure: <${BUILD_URL}console|Console> - <${BUILD_URL}artifact/_kola_temp.tar.xz|_kola_temp>\n$message```"
2 changes: 1 addition & 1 deletion os/kola/gce.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -104,5 +104,5 @@ timeout --signal=SIGQUIT 60m bin/kola run \
currentBuild.result = rc == 0 ? 'SUCCESS' : 'FAILURE'

if (currentBuild.result == 'FAILURE')
slackSend color: 'danger',
trySlackSend color: 'danger',
message: "```Kola: GCE-amd64 Failure: <${BUILD_URL}console|Console> - <${BUILD_URL}artifact/_kola_temp.tar.xz|_kola_temp>\n$message```"
2 changes: 1 addition & 1 deletion os/kola/oci.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -215,5 +215,5 @@ EOF
currentBuild.result = rc == 0 ? 'SUCCESS' : 'FAILURE'

if (currentBuild.result == 'FAILURE')
slackSend color: 'danger',
trySlackSend color: 'danger',
message: "```Kola: OCI-amd64 Failure: <${BUILD_URL}console|Console> - <${BUILD_URL}artifact/_kola_temp.tar.xz|_kola_temp>\n$message```"
2 changes: 1 addition & 1 deletion os/kola/packet.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -159,5 +159,5 @@ timeout --signal=SIGQUIT "${timeout}" bin/kola run \
currentBuild.result = rc == 0 ? 'SUCCESS' : 'FAILURE'

if (currentBuild.result == 'FAILURE')
slackSend color: 'danger',
trySlackSend color: 'danger',
message: "```Kola: Packet-$BOARD Failure: <${BUILD_URL}console|Console> - <${BUILD_URL}artifact/_kola_temp.tar.xz|_kola_temp>\n$message```"
2 changes: 1 addition & 1 deletion os/kola/qemu.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -151,5 +151,5 @@ fi
currentBuild.result = rc == 0 ? 'SUCCESS' : 'FAILURE'

if (currentBuild.result == 'FAILURE')
slackSend color: 'danger',
trySlackSend color: 'danger',
message: "```Kola: QEMU-amd64 Failure: <${BUILD_URL}console|Console> - <${BUILD_URL}artifact/_kola_temp.tar.xz|_kola_temp>\n$message```"
2 changes: 1 addition & 1 deletion os/kola/qemu_uefi.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -146,5 +146,5 @@ sudo rm -rf tmp
currentBuild.result = rc == 0 ? 'SUCCESS' : 'FAILURE'

if (currentBuild.result == 'FAILURE')
slackSend color: 'danger',
trySlackSend color: 'danger',
message: "```Kola: QEMU_UEFI-$BOARD Failure: <${BUILD_URL}console|Console> - <${BUILD_URL}artifact/_kola_temp.tar.xz|_kola_temp>\n$message```"
8 changes: 1 addition & 7 deletions os/manifest.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -287,13 +287,7 @@ do
done
''' /* Editor quote safety: ' */
}

String summary = readFile('message.txt').trim()
try {
slackSend color: '#2020C0', message: summary
} catch (NoSuchMethodError err) {
echo summary
}
trySlackSend color: '#2020C0', message: readFile('message.txt').trim()
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions os/nightly-build.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ stage('Downstream') {
def run = build job: 'manifest', propagate: false

if (run.result == 'SUCCESS')
slackSend color: 'good',
trySlackSend color: 'good',
message: ":partyparrot: The nightly OS build succeeded!\n${BUILD_URL}cldsv"
else
slackSend color: 'danger',
trySlackSend color: 'danger',
message: ":trashfire: The nightly OS build failed!\n${BUILD_URL}cldsv"

currentBuild.result = run.result
Expand Down
2 changes: 1 addition & 1 deletion os/tectonic-nightly.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ node('amd64 && docker') {
}

if (rc != 0)
slackSend color: 'danger',
trySlackSend color: 'danger',
message: "tectonic-nightly failed!\n$BUILD_URL",
channel: '@slowrie'

Expand Down

0 comments on commit 3512452

Please sign in to comment.