From b11c21571f5fdf635ef51904322a8dd414fe543e Mon Sep 17 00:00:00 2001 From: Paul Campbell Date: Sat, 10 Mar 2018 20:17:11 +0000 Subject: [PATCH] jenkins: only update sonarqube when on develop branch --- Jenkinsfile.groovy | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/Jenkinsfile.groovy b/Jenkinsfile.groovy index b6996f0..b3d4bdd 100644 --- a/Jenkinsfile.groovy +++ b/Jenkinsfile.groovy @@ -32,9 +32,14 @@ pipeline { sh "${mvn} checkstyle:checkstyle" sh "${mvn} pmd:pmd" pmd canComputeNew: false, defaultEncoding: '', healthy: '', pattern: '', unHealthy: '' - withSonarQubeEnv('sonarqube') { - sh "${mvn} org.sonarsource.scanner.maven:sonar-maven-plugin:3.4.0.905:sonar" - } + } + } + } + stage('SonarQube (develop only)') { + when { expression { env.GIT_BRANCH == 'develop' } } + steps { + withSonarQubeEnv('sonarqube') { + sh "${mvn} org.sonarsource.scanner.maven:sonar-maven-plugin:3.4.0.905:sonar" } } }