mirror of
https://github.com/scm-manager/scm-manager.git
synced 2026-05-06 08:37:13 +02:00
Jenkins: Tell SQ 2.0.0-m3 is the base branch for now
This commit is contained in:
10
Jenkinsfile
vendored
10
Jenkinsfile
vendored
@@ -40,7 +40,6 @@ node() { // No specific label
|
|||||||
|
|
||||||
def sonarQube = new SonarQube(this, 'sonarcloud.io')
|
def sonarQube = new SonarQube(this, 'sonarcloud.io')
|
||||||
|
|
||||||
// TODO move this to ces-build-lib so we can use "sonarqube.analyzeWith(mvn)" here
|
|
||||||
analyzeWith(mvn)
|
analyzeWith(mvn)
|
||||||
|
|
||||||
if (!sonarQube.waitForQualityGateWebhookToBeCalled()) {
|
if (!sonarQube.waitForQualityGateWebhookToBeCalled()) {
|
||||||
@@ -59,6 +58,9 @@ node() { // No specific label
|
|||||||
mailIfStatusChanged(commitAuthorEmail)
|
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) {
|
void analyzeWith(Maven mvn) {
|
||||||
|
|
||||||
withSonarQubeEnv('sonarcloud.io') {
|
withSonarQubeEnv('sonarcloud.io') {
|
||||||
@@ -77,9 +79,9 @@ void analyzeWith(Maven mvn) {
|
|||||||
"-Dsonar.pullrequest.bitbucketcloud.repository=sonarcloudtest "
|
"-Dsonar.pullrequest.bitbucketcloud.repository=sonarcloudtest "
|
||||||
} else {
|
} else {
|
||||||
mvnArgs += " -Dsonar.branch.name=${env.BRANCH_NAME} "
|
mvnArgs += " -Dsonar.branch.name=${env.BRANCH_NAME} "
|
||||||
if (!"default".equals(env.BRANCH_NAME)) {
|
if (!mainBranch.equals(env.BRANCH_NAME)) {
|
||||||
// Avoid exception "The main branch must not have a target" on master branch
|
// Avoid exception "The main branch must not have a target" on main branch
|
||||||
mvnArgs += " -Dsonar.branch.target=default "
|
mvnArgs += " -Dsonar.branch.target=${mainBranch} "
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
mvn "${mvnArgs}"
|
mvn "${mvnArgs}"
|
||||||
|
|||||||
Reference in New Issue
Block a user