mirror of
https://github.com/spring-projects/spring-petclinic.git
synced 2025-07-24 00:35:49 +00:00
added jenkins file changes
This commit is contained in:
parent
fe6c6f0f52
commit
08c9ff37c6
1 changed files with 28 additions and 8 deletions
36
jenkinsfile
36
jenkinsfile
|
@ -1,22 +1,42 @@
|
||||||
pipeline {
|
pipeline {
|
||||||
agent { label 'JAVA-11' }
|
agent { label 'JAVA-11' }
|
||||||
triggers { pollSCM( '* * * * *' ) }
|
triggers { pollSCM( '* * * * *' ) }
|
||||||
parameters { choice(name: 'BRANCH', choices: ['main', 'master', 'three'], description: 'Choose the branch') }
|
parameters {
|
||||||
|
string(name: 'MAVEN_TARGET', defaultValue: 'mvn package', description: 'describe maven targets')
|
||||||
|
choice(name: 'BRANCH', choices: ['main', 'master', 'three'], description: 'Choose the branch')
|
||||||
|
}
|
||||||
stages {
|
stages {
|
||||||
stage('clone') {
|
stage('clone') {
|
||||||
steps {
|
steps {
|
||||||
git branch: '${params.BRANCH}', url: 'https://github.com/GUDAPATIVENKATESH/spring-petclinic.git'
|
mail subject: "Build Started for jenkins job $env.JOB_NAME",
|
||||||
|
body: "Build Started for jenkins job $env.JOB_NAME",
|
||||||
|
to: "qtdevops@gmail.com"
|
||||||
|
git branch: "${params.BRANCH}", url: 'https://github.com/GUDAPATIVENKATESH/spring-petclinic.git'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
stage('Build') {
|
stage('Build') {
|
||||||
steps {
|
steps {
|
||||||
sh 'mvn package'
|
sh "${params.MAVEN_TARGET}"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
stage('results') {
|
|
||||||
steps {
|
}
|
||||||
junit '**/surefire-reports/*.xml'
|
post {
|
||||||
|
always {
|
||||||
|
mail subject: "build completed for jenkins job $env.JOB_NAME",
|
||||||
|
body: "build completed for jenkins job $env.JOB_NAME \n click here: $env.JOB_URL",
|
||||||
|
to: "qtdevops@gmail.com"
|
||||||
|
}
|
||||||
|
failure {
|
||||||
|
mail subject: "build failed for jenkins job $env.JOB_NAME",
|
||||||
|
body: "build failed for jenkins job $env.JOB_NAME" ,
|
||||||
|
to: "qtdevops@gmail.com"
|
||||||
|
}
|
||||||
|
success {
|
||||||
|
mail subject: "build success for jenkins job $env.JOB_NAME",
|
||||||
|
body: "build success for jenkins job $env.JOB_NAME" ,
|
||||||
|
to: "qtdevops@gmail.com"
|
||||||
|
junit '**/surefire-reports/*.xml'
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in a new issue