From 1410b03dd34213fd29db2f7a82a7458f116564f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Soko=C5=82owski?= Date: Wed, 14 Feb 2024 16:41:17 +0100 Subject: [PATCH] chore(ci): reuse discord send function from library MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Provides more info and requires less boilerplate. Signed-off-by: Jakub SokoĊ‚owski --- ci/Jenkinsfile.combined | 24 +++++------------------- 1 file changed, 5 insertions(+), 19 deletions(-) diff --git a/ci/Jenkinsfile.combined b/ci/Jenkinsfile.combined index 059f1b93d5..4897c5ffc4 100644 --- a/ci/Jenkinsfile.combined +++ b/ci/Jenkinsfile.combined @@ -1,5 +1,5 @@ #!/usr/bin/env groovy -library 'status-jenkins-lib@v1.8.3' +library 'status-jenkins-lib@v1.8.6' /* Object to store public URLs for description. */ urls = [:] @@ -86,24 +86,10 @@ pipeline { archiveArtifacts('pkg/*') } } failure { script { - withCredentials([ - string( - credentialsId: 'discord-status-desktop-webhook', - variable: 'DISCORD_WEBHOOK' - ), - ]) { - discordSend( - title: "${env.JOB_NAME}#${env.BUILD_NUMBER}", - description: """ - CI Desktop build Failure! - Branch: `${GIT_BRANCH}` - Commit: `${GIT_COMMIT.take(8)}` - """, - link: env.BUILD_URL, - result: currentBuild.currentResult, - webhookURL: env.DISCORD_WEBHOOK - ) - } + discord.send( + header: 'CI Desktop build Failure!', + cred: 'discord-status-desktop-webhook', + ) } } cleanup { cleanWs() } }