mirror of
https://github.com/spring-projects/spring-petclinic.git
synced 2025-07-21 14:55:51 +00:00
Sonar
Sonar
This commit is contained in:
parent
f54eeb1fb9
commit
69cf2b4ff7
1 changed files with 9 additions and 19 deletions
18
jenkinsfile
18
jenkinsfile
|
@ -8,31 +8,21 @@ node {
|
||||||
// ** in the global configuration.
|
// ** in the global configuration.
|
||||||
mvnHome = tool 'M3'
|
mvnHome = tool 'M3'
|
||||||
}
|
}
|
||||||
stage('Sonar Scan Execution'){
|
stage('Sonar Quality Analysis'){
|
||||||
//Run the sonar scan
|
//Run the sonar scan
|
||||||
steps {
|
|
||||||
script{
|
|
||||||
mvnHome = tool 'M3'
|
|
||||||
withSonarQubeDev{
|
withSonarQubeDev{
|
||||||
sh "'${mvnHome}/bin/mvn' verify sonar:sonar -Dsonar.projectKey=Petclinic -Dsonar.host.url=http://xyart81442dns1.eastus2.cloudapp.azure.com -Dsonar.login=bff9e0e153a1384234a2c18652327736550c1ecd-Dintegration-tests.skip=true -Dmaven.test.failure.ignore=true"
|
sh "'${mvnHome}/bin/mvn' verify sonar:sonar -Dsonar.projectKey=Petclinic -Dsonar.host.url=http://xyart81442dns1.eastus2.cloudapp.azure.com -Dsonar.login=bff9e0e153a1384234a2c18652327736550c1ecd-Dintegration-tests.skip=true -Dmaven.test.failure.ignore=true"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
stage('Sonar Quality Gate') {
|
||||||
}
|
timeout(time: 1, unit: 'HOURS') {
|
||||||
stage('Sonar scan result check') {
|
|
||||||
steps {
|
|
||||||
timeout(time: 2, unit: 'MINUTES') {
|
|
||||||
retry(3) {
|
|
||||||
script {
|
|
||||||
def qg = waitForQualityGate()
|
def qg = waitForQualityGate()
|
||||||
if (qg.status != 'OK') {
|
if (qg.status != 'OK') {
|
||||||
|
currentBuild.status='FAILURE'
|
||||||
error "Pipeline aborted due to quality gate failure: ${qg.status}"
|
error "Pipeline aborted due to quality gate failure: ${qg.status}"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
stage('Build') {
|
stage('Build') {
|
||||||
// Run the maven build
|
// Run the maven build
|
||||||
withEnv(["MVN_HOME=$mvnHome"]) {
|
withEnv(["MVN_HOME=$mvnHome"]) {
|
||||||
|
|
Loading…
Reference in a new issue