From 4956c9f243f01d8211d7e42b4e90003cffa95124 Mon Sep 17 00:00:00 2001 From: p-a-s-c-a-l Date: Thu, 27 Apr 2017 09:14:09 +0200 Subject: [PATCH] #11 use ${env.BRANCH_NAME} --- Jenkinsfile | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index a2c7696b5..7829a4430 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -3,25 +3,20 @@ pipeline { options { buildDiscarder(logRotator(numToKeepStr:'5')) - timeout(time: 60, unit: 'MINUTES') + timeout(time: 15, unit: 'MINUTES') disableConcurrentBuilds() } stages { stage('checkout') { steps { - checkout([$class: 'GitSCM', branches: [[name: '*/dev']], + checkout([$class: 'GitSCM', branches: [[name: "*/${env.BRANCH_NAME}"]], extensions: [[$class: 'CleanCheckout'], - [$class: 'LocalBranch', localBranch: 'dev']]]) + [$class: 'LocalBranch', localBranch: "${env.BRANCH_NAME}"]]]) } } stage('build') { - - when { - branch 'dev' - } - steps { withMaven( maven: 'default', // Tools declared in the Jenkins "Global Tool Configuration"