mirror of
https://github.com/spring-projects/spring-petclinic.git
synced 2025-07-26 17:35:49 +00:00
Added Sonar Environment
This commit is contained in:
parent
7311adfe9e
commit
c24789efbd
1 changed files with 13 additions and 5 deletions
16
Jenkinsfile
vendored
16
Jenkinsfile
vendored
|
@ -1,10 +1,13 @@
|
||||||
pipeline {
|
pipeline {
|
||||||
agent { label 'JDK_17' }
|
agent { label 'JDK_17' }
|
||||||
triggers { pollSCM ('* * * * *') }
|
triggers { pollSCM ('* * * * *') }
|
||||||
|
parameters {
|
||||||
|
choice(name: 'MAVEN_GOAL', choices: ['package', 'install', 'clean'], description: 'Maven Goal')
|
||||||
|
}
|
||||||
stages {
|
stages {
|
||||||
stage('vcs') {
|
stage('vcs') {
|
||||||
steps {
|
steps {
|
||||||
git url: 'https://github.com/Aseerwadham/spring-petclinic.git',
|
git url: 'https://github.com/khajadevopsmarch23/spring-petclinic.git',
|
||||||
branch: 'main'
|
branch: 'main'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -13,7 +16,14 @@ pipeline {
|
||||||
jdk 'JDK_17'
|
jdk 'JDK_17'
|
||||||
}
|
}
|
||||||
steps {
|
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') {
|
stage('post build') {
|
||||||
|
@ -25,5 +35,3 @@ pipeline {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue