mirror of
https://github.com/spring-projects/spring-petclinic.git
synced 2025-07-23 08:15:49 +00:00
added
This commit is contained in:
parent
bd479797a8
commit
1ef20b8248
1 changed files with 15 additions and 30 deletions
39
jenkinsfile
39
jenkinsfile
|
@ -1,42 +1,27 @@
|
||||||
pipeline {
|
pipeline {
|
||||||
agent { label 'JAVA-11' }
|
agent { label 'TRF' }
|
||||||
triggers { pollSCM( '* * * * *' ) }
|
|
||||||
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 {
|
||||||
mail subject: "Build Started for jenkins job $env.JOB_NAME",
|
git url: 'https://github.com/GUDAPATIVENKATESH/spring-petclinic.git',
|
||||||
body: "Build Started for jenkins job $env.JOB_NAME",
|
branch : 'main'
|
||||||
to: "qtdevops@gmail.com"
|
|
||||||
git branch: "${params.BRANCH}", url: 'https://github.com/GUDAPATIVENKATESH/spring-petclinic.git'
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
stage('Build') {
|
stage('build') {
|
||||||
steps {
|
steps {
|
||||||
sh "${params.MAVEN_TARGET}"
|
sh 'mvn install'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
stage('test_results') {
|
||||||
|
steps {
|
||||||
|
archiveArtifacts artifacts: '**/target/*.jar',
|
||||||
|
followSymlinks: false
|
||||||
}
|
}
|
||||||
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 {
|
stage('JUnit_test_results') {
|
||||||
mail subject: "build failed for jenkins job $env.JOB_NAME",
|
steps {
|
||||||
body: "build failed for jenkins job $env.JOB_NAME" ,
|
junit '**/target/surefire-reports/*.xml'
|
||||||
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