Jenkins: Tell SQ 2.0.0-m3 is the base branch for now

This commit is contained in:
Johannes Schnatterer
2018-07-12 10:55:03 +02:00
parent b4a0578ad3
commit 461645ede9

10
Jenkinsfile vendored
View File

@@ -40,7 +40,6 @@ node() { // No specific label
def sonarQube = new SonarQube(this, 'sonarcloud.io')
// TODO move this to ces-build-lib so we can use "sonarqube.analyzeWith(mvn)" here
analyzeWith(mvn)
if (!sonarQube.waitForQualityGateWebhookToBeCalled()) {
@@ -59,6 +58,9 @@ 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"
void analyzeWith(Maven mvn) {
withSonarQubeEnv('sonarcloud.io') {
@@ -77,9 +79,9 @@ void analyzeWith(Maven mvn) {
"-Dsonar.pullrequest.bitbucketcloud.repository=sonarcloudtest "
} else {
mvnArgs += " -Dsonar.branch.name=${env.BRANCH_NAME} "
if (!"default".equals(env.BRANCH_NAME)) {
// Avoid exception "The main branch must not have a target" on master branch
mvnArgs += " -Dsonar.branch.target=default "
if (!mainBranch.equals(env.BRANCH_NAME)) {
// Avoid exception "The main branch must not have a target" on main branch
mvnArgs += " -Dsonar.branch.target=${mainBranch} "
}
}
mvn "${mvnArgs}"