mirror of
https://github.com/spring-projects/spring-petclinic.git
synced 2026-01-07 11:01:10 +00:00
61 lines
1.3 KiB
Groovy
61 lines
1.3 KiB
Groovy
pipeline {
|
|
agent any
|
|
stages {
|
|
stage("BuildCode"){
|
|
steps {
|
|
sh """
|
|
|
|
./mvnw package
|
|
|
|
"""
|
|
}
|
|
}
|
|
|
|
stage("RunTests"){
|
|
steps {
|
|
sh """
|
|
|
|
./mvnw test
|
|
|
|
"""
|
|
}
|
|
}
|
|
|
|
stage("Sonar-Scanning") {
|
|
steps {
|
|
withSonarQubeEnv('sonarqube') {
|
|
sh """
|
|
|
|
./mvnw clean verify sonar:sonar \
|
|
-Dsonar.projectKey=spring-petclinic \
|
|
-Dsonar.projectName=spring-petclinic
|
|
|
|
"""
|
|
}
|
|
}
|
|
}
|
|
|
|
stage("QualityGate"){
|
|
steps {
|
|
timeout(time: 1, unit: 'MINUTES') {
|
|
waitForQualityGate abortPipeline: true
|
|
}
|
|
}
|
|
}
|
|
|
|
stage('Upload Artifacts') {
|
|
when {
|
|
expression { currentBuild.result == null || currentBuild.result == 'SUCCESS' }
|
|
}
|
|
steps {
|
|
archiveArtifacts artifacts: 'target/*.jar', fingerprint: true
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|