From f9b59f33debc9c8b6b0b97d6caa76e9cc91490ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lubom=C3=ADr=20Jahn?= Date: Thu, 7 Dec 2023 16:11:38 +0100 Subject: [PATCH 1/2] Fix jenkinsfile notification block --- Jenkinsfile | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 2c2a432e1..ad24da0aa 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -16,10 +16,6 @@ pipeline { TOBLOCK = '4600000' } - parameters { - string(defaultValue: "develop", description: 'Which branch?', name: 'BRANCH_NAME') - } - stages { stage('Build') { steps { @@ -135,7 +131,7 @@ pipeline { post { always { script { - if( params.BRANCH_NAME == 'develop' ){ + if( env.BRANCH_NAME == 'develop' ){ build job: '/Notifications/slack-notification-pipeline', parameters: [ string(name: 'result', value: "${currentBuild.result}"), string(name: 'name', value: "${currentBuild.fullDisplayName}"), From 0fa4afb52308f0089e874ef3cf5da347743d703b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lubom=C3=ADr=20Jahn?= Date: Mon, 11 Dec 2023 14:23:13 +0100 Subject: [PATCH 2/2] Add params to jenkinsfile post block notification --- Jenkinsfile | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index ad24da0aa..9f1e88b46 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -130,16 +130,14 @@ pipeline { post { always { - script { - if( env.BRANCH_NAME == 'develop' ){ - build job: '/Notifications/slack-notification-pipeline', parameters: [ - string(name: 'result', value: "${currentBuild.result}"), - string(name: 'name', value: "${currentBuild.fullDisplayName}"), - string(name: 'duration', value: "${currentBuild.duration}"), - string(name: 'url', value: "$currentBuild.absoluteUrl") - ] - } - } + build job: '/Notifications/slack-notification-pipeline', parameters: [ + string(name: 'result', value: "${currentBuild.result}"), + string(name: 'name', value: "${currentBuild.fullDisplayName}"), + string(name: 'duration', value: "${currentBuild.duration}"), + string(name: 'url', value: "$currentBuild.absoluteUrl"), + string(name: 'user', value: env.GIT_COMMITTER_NAME), + string(name: 'branch', value: env.BRANCH_NAME), + ] } } }