mirror of
https://github.com/spring-projects/spring-petclinic.git
synced 2025-07-19 14:25:50 +00:00
Jekins added
This commit is contained in:
parent
579c32fac8
commit
164549ae03
1 changed files with 5 additions and 42 deletions
47
Jenkinsfile
vendored
47
Jenkinsfile
vendored
|
@ -1,52 +1,15 @@
|
||||||
pipeline {
|
pipeline {
|
||||||
|
|
||||||
agent any
|
agent any
|
||||||
|
|
||||||
stages {
|
stages {
|
||||||
|
|
||||||
stage ("Build"){
|
stage ("Build") {
|
||||||
steps {
|
steps {
|
||||||
sh "./mvnw install"
|
sh"./mvwn install"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
stage ("Run unit-test"){
|
|
||||||
|
|
||||||
steps {
|
|
||||||
sh "./mvnw test"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
stage ("CodeScaning"){
|
|
||||||
environment {
|
|
||||||
SONAR_HOME = tool 'sonar-scan'
|
|
||||||
}
|
|
||||||
steps{
|
|
||||||
withSonarQubeEnv('SonarServer') {
|
|
||||||
sh '''$SONAR_HOME/bin/sonar-scanner \
|
|
||||||
-Dsonar.projectKey=myPETC \
|
|
||||||
-Dsonar.projectName=mypetclinc \
|
|
||||||
-Dsonar.sources=. \
|
|
||||||
-Dsonar.java.binaries=target/classes \
|
|
||||||
-Dsonar.exclusions=src/test/java/****/*.java \
|
|
||||||
-Dsonar.analysis.mode=publish \
|
|
||||||
-Dsonar.projectVersion=${BUILD_NUMBER}-${GIT_COMMIT_SHORT}
|
|
||||||
|
|
||||||
'''
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
stage('Quality Gate') {
|
|
||||||
steps {
|
|
||||||
timeout(time: 5, unit: 'MINUTES') {
|
|
||||||
waitForQualityGate abortPipeline: true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue