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
48
Jenkinsfile
vendored
48
Jenkinsfile
vendored
|
@ -1,27 +1,33 @@
|
||||||
pipeline{
|
pipeline{
|
||||||
agent{
|
agent { label 'node' }
|
||||||
label 'springpet'
|
// triggers { pollSCM ('H * * * 1-5') }
|
||||||
}
|
parameters {
|
||||||
stages {
|
choice (name: 'BRANCH_TO_BUILD', choices: ['main'], description: 'Branch to build')
|
||||||
stage ('scm'){
|
string (name: 'MAVEN_GOAL', defaultValue: 'clean install', description: 'maven goal')
|
||||||
steps {
|
}
|
||||||
|
stages {
|
||||||
git url: "https://github.com/nagarjuna33/spring-petclinicnew.git",
|
stage('scm') {
|
||||||
branch: 'main'
|
steps {
|
||||||
|
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 ('build package') {
|
stage('Quality Gate') {
|
||||||
|
|
||||||
steps {
|
steps {
|
||||||
sh 'mvn package'
|
timeout(time: 20, unit: 'MINUTES'){
|
||||||
}
|
waitForQualityGate abortPipeline: true
|
||||||
}
|
}
|
||||||
stage ('deployment') {
|
}
|
||||||
|
}
|
||||||
steps {
|
|
||||||
sh 'ansible-playbook -i /home/ansible/inventory.yml springpet.yml '
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue