From 5b42c98780fe938ff79c54229aa80cdd47a17568 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Soko=C5=82owski?= Date: Tue, 27 Sep 2022 16:08:56 +0200 Subject: [PATCH] ci: add Discord notification for successful builds MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This way teams can track what deployments happen when. Signed-off-by: Jakub SokoĊ‚owski --- ci/Jenkinsfile.docker | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/ci/Jenkinsfile.docker b/ci/Jenkinsfile.docker index e1d4de63..ada9d751 100644 --- a/ci/Jenkinsfile.docker +++ b/ci/Jenkinsfile.docker @@ -60,6 +60,27 @@ pipeline { } } post { + success { script { + withCredentials([ + string( + credentialsId: 'discord-waku-deployments-webhook', + variable: 'DISCORD_WEBHOOK' + ), + ]) { + discordSend( + title: "${env.JOB_NAME}#${env.BUILD_NUMBER}", + description: """ + Go-Waku deployment successful! + Image: [`${IMAGE_NAME}:${IMAGE_TAG}`](https://hub.docker.com/r/${IMAGE_NAME}/tags?page=1&name=${IMAGE_TAG}) + Branch: [`${GIT_BRANCH.minus("origin/")}`](https://github.com/status-im/nwaku/commits/${GIT_BRANCH.minus("origin/")}) + Commit: [`${GIT_COMMIT.take(8)}`](https://github.com/status-im/nwaku/commit/${GIT_COMMIT.take(8)}) + """, + link: env.BUILD_URL, + result: currentBuild.currentResult, + webhookURL: env.DISCORD_WEBHOOK + ) + } + } } always { cleanWs() } } }