-
Bug
-
Resolution: Fixed
-
Minor
-
None
-
Jenkins 2.48
Linux (CentOS)
SonarQube 6.2
It appears that stage like these are not possible?
stage ("SonarQube analysis") { steps { script { STAGE_NAME = "SonarQube analysis" if (BRANCH_NAME == "develop") { echo "In 'develop' branch, don't analyze." } else { // this is a PR build, run sonar analysis withSonarQubeEnv("SonarGate") { sh "../../../sonar-scanner-2.9.0.670/bin/sonar-scanner" } } } } } stage ("SonarQube Gatekeeper") { steps { script { STAGE_NAME = "SonarQube Gatekeeper" if (BRANCH_NAME == "develop") { echo "In 'develop' branch, skip." } else { // this is a PR build, fail on threshold spill def qualitygate = waitForQualityGate() if (qualitygate.status != "OK") { error "Pipeline aborted due to quality gate coverage failure: ${qualitygate.status}" } } } } }
It fails with: "Please use the 'withSonarQubeEnv' wrapper to run your analysis.", but I am using it... Jenkins does not recognize it? full logs in the question link above.
This was a Sonar bug with remote slaves (see answer to the mentioned Stack Overflow question). Closing.