mirror of
https://github.com/spring-projects/spring-petclinic.git
synced 2025-07-20 14:55:50 +00:00
Create Jenkinsfile.txt
This commit is contained in:
parent
19a1fe447f
commit
109386d4ab
1 changed files with 30 additions and 0 deletions
30
Jenkinsfile.txt
Normal file
30
Jenkinsfile.txt
Normal file
|
@ -0,0 +1,30 @@
|
||||||
|
pipeline {
|
||||||
|
agent any
|
||||||
|
triggers {
|
||||||
|
cron('H/10 * * * 1') // Trigger every 10 minutes on Mondays
|
||||||
|
}
|
||||||
|
stages {
|
||||||
|
stage('Build') {
|
||||||
|
steps {
|
||||||
|
script {
|
||||||
|
// Run Maven build
|
||||||
|
sh 'mvn clean package'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
stage('Code Coverage') {
|
||||||
|
steps {
|
||||||
|
script {
|
||||||
|
// Run tests and generate Jacoco report
|
||||||
|
sh 'mvn test jacoco:report'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
post {
|
||||||
|
always {
|
||||||
|
// Archive the Jacoco report
|
||||||
|
archiveArtifacts artifacts: 'target/site/jacoco/*.html', fingerprint: true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in a new issue