Use script for telegram notification

Jenkins' declarative pipelines have interesting requirements around when
you can use traditional groovy scripting in the pipeline and some items
in `post` require special handling.

Signed-off-by: Major Hayden <major@redhat.com>
This commit is contained in:
Major Hayden 2020-07-20 07:54:13 -05:00 committed by Christian Kellner
parent cc494ec04b
commit dd6981c481

18
schutzbot/Jenkinsfile vendored
View file

@ -158,12 +158,22 @@ pipeline {
post {
success {
when { branch 'master' }
telegramSend "💚 CI passed for osbuild-composer master branch!. ${env.BUILD_URL}"
node('schutzbot') {
script {
if (env.BRANCH_NAME == 'master') {
telegramSend "💚 CI passed for osbuild master branch ${env.BUILD_URL}"
}
}
}
}
unsuccessful {
when { branch 'master' }
telegramSend "💣 CI failed for osbuild-composer master branch! ${env.BUILD_URL}"
node('schutzbot') {
script {
if (env.BRANCH_NAME == 'master') {
telegramSend "💣 CI failed for osbuild master branch ${env.BUILD_URL}"
}
}
}
}
}