Create Jenkinsfile.txt

This commit is contained in:
Giridharan Paramasivam 2024-10-17 10:53:01 -04:00
parent 19a1fe447f
commit 109386d4ab

30
Jenkinsfile.txt Normal file
View 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
}
}
}