mirror of
https://github.com/spring-projects/spring-petclinic.git
synced 2025-07-27 09:55:49 +00:00
Added changes
This commit is contained in:
parent
88608d28f9
commit
10bce99a32
1 changed files with 37 additions and 0 deletions
37
Jenkinsfile
vendored
37
Jenkinsfile
vendored
|
@ -0,0 +1,37 @@
|
|||
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/khajadevopsmarch23/spring-petclinic.git',
|
||||
branch: 'declarative'
|
||||
}
|
||||
}
|
||||
|
||||
stage('package') {
|
||||
tools {
|
||||
jdk 'JDK_17'
|
||||
}
|
||||
sh "mvn ${params.MAVEN_GOAL}"
|
||||
}
|
||||
}
|
||||
stage('sonar analysis') {
|
||||
steps {
|
||||
// performing sonarqube analysis with "withSonarQubeENV(<Name of Server configured in Jenkins>)"
|
||||
withSonarQubeEnv('SONAR_CLOUD') {
|
||||
sh 'mvn verify org.sonarsource.scanner.maven:sonar-maven-plugin:sonar -Dsonar.projectKey=nan_sonarcube'
|
||||
}
|
||||
}
|
||||
}
|
||||
stage('post build') {
|
||||
steps {
|
||||
archiveArtifacts artifacts: '**/target/spring-petclinic-3.0.0-SNAPSHOT.jar',
|
||||
onlyIfSuccessful: true
|
||||
junit testResults: '**/surefire-reports/TEST-*.xml'
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue