File tree 1 file changed +5
-1
lines changed
1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change 30
30
checkout scm
31
31
withCredentials([string(credentialsId : ' spring-sonar.login' , variable : ' SONAR_LOGIN' )]) {
32
32
try {
33
- sh " ./gradlew sonarqube -PexcludeProjects='**/samples/**' -Dsonar.host.url=$SPRING_SONAR_HOST_URL -Dsonar.login=$SONAR_LOGIN --refresh-dependencies --no-daemon --stacktrace"
33
+ if (" master" == env. BRANCH_NAME ) {
34
+ sh " ./gradlew sonarqube -PexcludeProjects='**/samples/**' -Dsonar.host.url=$SPRING_SONAR_HOST_URL -Dsonar.login=$SONAR_LOGIN --refresh-dependencies --no-daemon --stacktrace"
35
+ } else {
36
+ sh " ./gradlew sonarqube -PexcludeProjects='**/samples/**' -Dsonar.projectKey='spring-security-${ env.BRANCH_NAME} ' -Dsonar.projectName='spring-security-${ env.BRANCH_NAME} ' -Dsonar.host.url=$SPRING_SONAR_HOST_URL -Dsonar.login=$SONAR_LOGIN --refresh-dependencies --no-daemon --stacktrace"
37
+ }
34
38
} catch (Exception e) {
35
39
currentBuild. result = ' FAILED: sonar'
36
40
throw e
You can’t perform that action at this time.
0 commit comments