mirror of
https://github.com/spring-projects/spring-petclinic.git
synced 2025-07-26 17:35:49 +00:00
Update Jenkinsfile
This commit is contained in:
parent
ddc636a943
commit
f78e0cba20
1 changed files with 27 additions and 21 deletions
46
Jenkinsfile
vendored
46
Jenkinsfile
vendored
|
@ -1,27 +1,33 @@
|
|||
pipeline{
|
||||
agent{
|
||||
label 'springpet'
|
||||
}
|
||||
stages {
|
||||
stage ('scm'){
|
||||
steps {
|
||||
|
||||
git url: "https://github.com/nagarjuna33/spring-petclinicnew.git",
|
||||
branch: 'main'
|
||||
}
|
||||
}
|
||||
stage ('build package') {
|
||||
|
||||
steps {
|
||||
sh 'mvn package'
|
||||
agent { label 'node' }
|
||||
// triggers { pollSCM ('H * * * 1-5') }
|
||||
parameters {
|
||||
choice (name: 'BRANCH_TO_BUILD', choices: ['main'], description: 'Branch to build')
|
||||
string (name: 'MAVEN_GOAL', defaultValue: 'clean install', description: 'maven goal')
|
||||
}
|
||||
}
|
||||
stage ('deployment') {
|
||||
|
||||
stages {
|
||||
stage('scm') {
|
||||
steps {
|
||||
sh 'ansible-playbook -i /home/ansible/inventory.yml springpet.yml '
|
||||
}
|
||||
git: "url: https://github.com/nagarjuna33/spring-petclinicnew.git",
|
||||
branch:"${params.BRANCH_TO_BUILD}"
|
||||
}
|
||||
}
|
||||
|
||||
stage ('sonarqube') {
|
||||
steps{
|
||||
withSonarQubeEnv('sonarqube') {
|
||||
sh 'mvn clean package sonar:sonar'
|
||||
}
|
||||
}
|
||||
}
|
||||
stage('Quality Gate') {
|
||||
steps {
|
||||
timeout(time: 20, unit: 'MINUTES'){
|
||||
waitForQualityGate abortPipeline: true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue