mirror of
https://github.com/spring-projects/spring-petclinic.git
synced 2025-07-20 06:45:50 +00:00
fixing jenkinsfile
This commit is contained in:
parent
582832cce5
commit
c875f10c62
1 changed files with 8 additions and 13 deletions
21
Jenkinsfile
vendored
21
Jenkinsfile
vendored
|
@ -1,35 +1,30 @@
|
||||||
pipeline {
|
pipeline {
|
||||||
agent any
|
agent any
|
||||||
|
|
||||||
triggers {
|
|
||||||
cron('H/10 * * * 1') // This triggers the job every 10 minutes on Mondays
|
|
||||||
}
|
|
||||||
|
|
||||||
stages {
|
stages {
|
||||||
|
stage('Checkout') {
|
||||||
|
steps {
|
||||||
|
checkout scm
|
||||||
|
}
|
||||||
|
}
|
||||||
stage('Build') {
|
stage('Build') {
|
||||||
steps {
|
steps {
|
||||||
script {
|
script {
|
||||||
// Ensure you have Maven installed in your Jenkins instance
|
|
||||||
sh 'mvn clean package'
|
sh 'mvn clean package'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
stage('Code Coverage') {
|
stage('Code Coverage') {
|
||||||
steps {
|
steps {
|
||||||
script {
|
script {
|
||||||
// Run tests and generate code coverage report using Jacoco
|
sh 'mvn jacoco:report'
|
||||||
sh 'mvn clean test jacoco:report'
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
post {
|
post {
|
||||||
always {
|
always {
|
||||||
// Archive the code coverage report
|
archiveArtifacts artifacts: '**/target/site/jacoco/**', allowEmptyArchive: true
|
||||||
junit '**/target/surefire-reports/*.xml' // Adjust the path if necessary
|
|
||||||
publishCoverage adapters: [jacocoAdapter('**/target/jacoco.exec')]
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue