Adding a sample SonarQube configuration.

This commit is contained in:
Christopher Jones 2017-09-06 08:14:04 -05:00
parent 7852dc58b8
commit 0aea718e5e

24
Jenkinsfile vendored
View file

@ -16,6 +16,30 @@ pipeline {
} }
} }
stage('SonarQube analysis') {
withSonarQubeEnv('SonarQube Scanner 3.0.3.778') {
sh 'mvn org.sonarsource.scanner.maven:sonar-maven-plugin:3.3.0.603:sonar ' +
'-f pom.xml ' +
'-Dsonar.projectKey=com.huettermann:all:master ' +
'-Dsonar.login=$SONAR_UN ' +
'-Dsonar.password=$SONAR_PW ' +
'-Dsonar.language=java ' +
'-Dsonar.sources=. ' +
'-Dsonar.tests=. ' +
'-Dsonar.test.inclusions=**/*Test*/** ' +
'-Dsonar.exclusions=**/*Test*/**'
}
}
stage("SonarQube Quality Gate") {
timeout(time: 1, unit: 'HOURS') {
def qg = waitForQualityGate()
if (qg.status != 'OK') {
error "Pipeline aborted due to quality gate failure: ${qg.status}"
}
}
}
stage('Approve for QA') { stage('Approve for QA') {
agent any agent any
steps { steps {