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:
parent
2259f92ed3
commit
1410b03dd3
|
@ -1,5 +1,5 @@
|
||||||
#!/usr/bin/env groovy
|
#!/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. */
|
/* Object to store public URLs for description. */
|
||||||
urls = [:]
|
urls = [:]
|
||||||
|
@ -86,24 +86,10 @@ pipeline {
|
||||||
archiveArtifacts('pkg/*')
|
archiveArtifacts('pkg/*')
|
||||||
} }
|
} }
|
||||||
failure { script {
|
failure { script {
|
||||||
withCredentials([
|
discord.send(
|
||||||
string(
|
header: 'CI Desktop build Failure!',
|
||||||
credentialsId: 'discord-status-desktop-webhook',
|
cred: '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
|
|
||||||
)
|
|
||||||
}
|
|
||||||
} }
|
} }
|
||||||
cleanup { cleanWs() }
|
cleanup { cleanWs() }
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue