From f3374255b5723bb205cdfa5f95dc899ac5c460c1 Mon Sep 17 00:00:00 2001 From: Johannes Schnatterer Date: Thu, 12 Jul 2018 11:46:50 +0200 Subject: [PATCH] Jenkins: Declares main branch earlier in the build. Fixes No such property: mainBranch for class: groovy.lang.Binding --- Jenkinsfile | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index ff9c5ae4d3..5d8a652c17 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -6,6 +6,9 @@ import com.cloudogu.ces.cesbuildlib.* node() { // No specific label + // Change this as when we go back to default - necessary for proper SonarQube analysis + mainBranch = "2.0.0-m3" + properties([ // Keep only the last 10 build to preserve space buildDiscarder(logRotator(numToKeepStr: '10')), @@ -55,13 +58,12 @@ node() { // No specific label mailIfStatusChanged(commitAuthorEmail) } -// Change this as when we go back to default - necessary for proper SonarQube analysis -String mainBranch = "2.0.0-m3" +String mainBranch Maven setupMavenBuild() { Maven mvn = new MavenWrapper(this) - if (env.BRANCH_NAME == "master") { + if (mainBranch.equals(env.BRANCH_NAME)) { // Release starts javadoc, which takes very long, so do only for certain branches mvn.additionalArgs += ' -DperformRelease' // JDK8 is more strict, we should fix this before the next release. Right now, this is just not the focus, yet.