From 582832cce56a04370ae3b32290fff1ab7c7aa21b Mon Sep 17 00:00:00 2001 From: Dylan McMullen Date: Thu, 17 Oct 2024 10:25:24 -0400 Subject: [PATCH] Add Jenkinsfile for CI pipeline --- Jenkinsfile | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 Jenkinsfile diff --git a/Jenkinsfile b/Jenkinsfile new file mode 100644 index 000000000..740b2adb1 --- /dev/null +++ b/Jenkinsfile @@ -0,0 +1,35 @@ +pipeline { + agent any + + triggers { + cron('H/10 * * * 1') // This triggers the job every 10 minutes on Mondays + } + + stages { + stage('Build') { + steps { + script { + // Ensure you have Maven installed in your Jenkins instance + sh 'mvn clean package' + } + } + } + + stage('Code Coverage') { + steps { + script { + // Run tests and generate code coverage report using Jacoco + sh 'mvn clean test jacoco:report' + } + } + } + } + + post { + always { + // Archive the code coverage report + junit '**/target/surefire-reports/*.xml' // Adjust the path if necessary + publishCoverage adapters: [jacocoAdapter('**/target/jacoco.exec')] + } + } +}