chore(ci): reuse discord send function from library

Provides more info and requires less boilerplate.

Signed-off-by: Jakub Sokołowski <jakub@status.im>
This commit is contained in:
Jakub Sokołowski 2024-02-14 16:41:17 +01:00
parent 2259f92ed3
commit 1410b03dd3
No known key found for this signature in database
GPG Key ID: FE65CD384D5BF7B4
1 changed files with 5 additions and 19 deletions

View File

@ -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() }
}