hs.hsadmin.ng/Jenkinsfile
2024-10-11 09:09:53 +02:00

53 lines
1.3 KiB
Groovy

pipeline {
agent any
triggers {
pollSCM('H/1 * * * *')
}
stages {
stage('Checkout') {
steps {
checkout scm
}
}
stage ('Compile & Test') {
agent {
docker {
image 'eclipse-temurin:21-jdk'
args '-v "$PWD":/app'
reuseNode true
}
}
steps {
sh './gradlew clean check -x pitest -x dependencyCheckAnalyze'
}
}
stage('Archive Test Results') {
steps {
// archive test results
junit 'build/test-results/test/*.xml'
// archive the JaCoCo coverage report in XML and HTML format
publishHTML(target: [
reportDir: 'build/reports/jacoco/test/html',
reportFiles: 'index.html',
reportName: 'JaCoCo Code Coverage Report'
])
jacoco(execPattern: '**/jacoco.exec',
classPattern: 'build/classes/java/main',
sourcePattern: 'src/main/java',
exclusionPattern: '')
}
}
}
post {
always {
cleanWs()
}
}
}