Newer
Older
pipeline {
agent any
environment {
scannerHome = tool 'SonarQube Scanner'
}
options {
buildDiscarder(logRotator(numToKeepStr: '10', artifactNumToKeepStr: '10'))
}
tools {
// Install the Maven version configured as "M3" and add it to the path.
maven "/usr/share/maven"
sh "mvn -Dmaven.test.failure.ignore=true clean verify"
junit(testResults: 'target/test-results/test/**/*.xml,target/test-results/integrationTest/**/*.xml', healthScaleFactor: 100)
jacoco(execPattern: 'target/jacoco/test/test.exec,target/jacoco/integrationTest/integrationTest.exec', sourcePattern: 'src/main/java', sourceInclusionPattern: '**/*.java')
stage('SonarAnalysis') {
steps {
milestone 3
sh "${scannerHome}/bin/sonar-scanner -Dsonar.projectKey=GITSEARCH$BRANCH_NAME \"-Dsonar.projectName=Sharing Plattform $BRANCH_NAME\""
failure {
notifyByEmail("Failure");
}
unstable {
notifyByEmail("Unstable");
}
fixed {
notifyByEmail("Fixed");
}
}
emailext (
subject: reason + ": Job '${env.JOB_NAME} [${env.BUILD_NUMBER}]'",
body: '''${SCRIPT, template="groovy-html.template"}''',
mimeType: 'text/html',
recipientProviders: [[$class: 'CulpritsRecipientProvider']]
)
}