mirror of
https://github.com/spring-projects/spring-petclinic.git
synced 2025-07-26 01:15:50 +00:00
Added Sonar Environment
This commit is contained in:
parent
7311adfe9e
commit
c24789efbd
1 changed files with 13 additions and 5 deletions
18
Jenkinsfile
vendored
18
Jenkinsfile
vendored
|
@ -1,10 +1,13 @@
|
|||
pipeline {
|
||||
agent { label 'JDK_17' }
|
||||
triggers { pollSCM ('* * * * *') }
|
||||
parameters {
|
||||
choice(name: 'MAVEN_GOAL', choices: ['package', 'install', 'clean'], description: 'Maven Goal')
|
||||
}
|
||||
stages {
|
||||
stage('vcs') {
|
||||
steps {
|
||||
git url: 'https://github.com/Aseerwadham/spring-petclinic.git',
|
||||
git url: 'https://github.com/khajadevopsmarch23/spring-petclinic.git',
|
||||
branch: 'main'
|
||||
}
|
||||
}
|
||||
|
@ -13,7 +16,14 @@ pipeline {
|
|||
jdk 'JDK_17'
|
||||
}
|
||||
steps {
|
||||
sh "./mvnw package"
|
||||
sh "mvn ${params.MAVEN_GOAL}"
|
||||
}
|
||||
}
|
||||
stage('sonar analysis') {
|
||||
steps {
|
||||
withSonarQubeEnv('SONAR_CLOUD') {
|
||||
sh 'mvn clean package sonar:sonar -Dsonar.organization=springpetclinic143'
|
||||
}
|
||||
}
|
||||
}
|
||||
stage('post build') {
|
||||
|
@ -24,6 +34,4 @@ pipeline {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue