Skip to content

Commit

Permalink
update cmd sonar
Browse files Browse the repository at this point in the history
  • Loading branch information
soulseen committed Apr 4, 2019
1 parent 70f1f98 commit a36c3a2
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 14 deletions.
14 changes: 8 additions & 6 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,15 @@ pipeline {

stage('sonarqube analysis') {
steps {
withCredentials([string(credentialsId: 'sonar-token', variable: 'SONAR_TOKEN')]) {
withSonarQubeEnv('sonar') {
sh "mvn -o -gs `pwd`/configuration/settings.xml -Dsonar.branch=$BRANCH_NAME -Dsonar.sources=. -Dsonar.login=$SONAR_TOKEN"
container ('maven') {
withCredentials([string(credentialsId: 'sonar-token', variable: 'SONAR_TOKEN')]) {
withSonarQubeEnv('sonar') {
sh "mvn sonar:sonar -o -gs `pwd`/configuration/settings.xml -Dsonar.branch=$BRANCH_NAME -Dsonar.sources=. -Dsonar.login=$SONAR_TOKEN"
}
}
timeout(time: 1, unit: 'HOURS') {
waitForQualityGate abortPipeline: true
}
}
timeout(time: 1, unit: 'HOURS') {
waitForQualityGate abortPipeline: true
}
}
}
Expand Down
16 changes: 9 additions & 7 deletions Jenkinsfile-online
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,16 @@ pipeline {

stage('sonarqube analysis') {
steps {
withCredentials([string(credentialsId: 'sonar-token', variable: 'SONAR_TOKEN')]) {
withSonarQubeEnv('sonar') {
sh "mvn -gs `pwd`/configuration/settings.xml -Dsonar.branch=$BRANCH_NAME -Dsonar.sources=. -Dsonar.login=$SONAR_TOKEN"
container ('maven') {
withCredentials([string(credentialsId: 'sonar-token', variable: 'SONAR_TOKEN')]) {
withSonarQubeEnv('sonar') {
sh "mvn sonar:sonar -o -gs `pwd`/configuration/settings.xml -Dsonar.branch=$BRANCH_NAME -Dsonar.sources=. -Dsonar.login=$SONAR_TOKEN"
}
}
}
timeout(time: 1, unit: 'HOURS') {
waitForQualityGate abortPipeline: true
}
timeout(time: 1, unit: 'HOURS') {
waitForQualityGate abortPipeline: true
}
}
}
}

Expand Down
2 changes: 1 addition & 1 deletion configuration/settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
<id>sonar</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
</activation>
</profile>
</profiles>
<mirrors>
Expand Down

0 comments on commit a36c3a2

Please sign in to comment.