From b576062f4880e54a4f85fe4adcc046d68d9d8e91 Mon Sep 17 00:00:00 2001 From: Jan Kaluza Date: Feb 21 2019 12:14:58 +0000 Subject: Define scmVars in Jenkinsfile --- diff --git a/Jenkinsfile b/Jenkinsfile index 32316ac..5f69e20 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -19,6 +19,17 @@ sudo dnf -y install \ try { // massive try{} catch{} around the entire build for failure notifications +node('master'){ + scmVars = checkout scm + scmVars.GIT_BRANCH_NAME = scmVars.GIT_BRANCH.split('/')[-1] // origin/pr/1234 -> 1234 + + // setting build display name + def branch = scmVars.GIT_BRANCH_NAME + if ( branch == 'master' ) { + echo 'Building master' + } +} + timestamps { node('fedora-28') { checkout scm