2018-07-16 16:43:38 +02:00
|
|
|
pipeline {
|
|
|
|
agent {
|
|
|
|
docker {
|
2018-07-16 17:42:52 +02:00
|
|
|
image 'sgdc3/maven-argon2:3.5.4-jdk-10'
|
2018-07-16 16:43:38 +02:00
|
|
|
args '-v $HOME/.m2:/root/.m2'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
options {
|
2018-07-16 19:14:52 +02:00
|
|
|
timeout(time: 5, unit: 'MINUTES')
|
2018-07-16 16:43:38 +02:00
|
|
|
timestamps()
|
|
|
|
}
|
|
|
|
|
|
|
|
stages {
|
2018-07-16 18:55:31 +02:00
|
|
|
stage ('Checkout') {
|
2018-07-16 16:43:38 +02:00
|
|
|
steps {
|
|
|
|
script {
|
|
|
|
env.CI_SKIP = "false"
|
|
|
|
result = sh (script: "git log -1 | grep '(?s).[CI[-\\s]SKIP].*'", returnStatus: true)
|
|
|
|
if (result == 0) {
|
|
|
|
env.CI_SKIP = "true"
|
|
|
|
error "'[CI-SKIP]' found in git commit message. Aborting."
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2018-07-16 18:55:31 +02:00
|
|
|
stage ('Clean') {
|
|
|
|
steps {
|
|
|
|
sh 'mvn -B clean'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
stage ('Build & Deploy') {
|
2018-07-16 16:43:38 +02:00
|
|
|
steps {
|
2018-07-16 20:03:18 +02:00
|
|
|
withCredentials([string(credentialsId: 'authme-coveralls-token', variable: 'COVERALLS_TOKEN')]) {
|
|
|
|
sh 'mvn -B clean package javadoc:aggregate-jar source:jar deploy coveralls:report -DrepoToken=$COVERALLS_TOKEN'
|
|
|
|
}
|
2018-07-16 18:55:31 +02:00
|
|
|
}
|
|
|
|
post {
|
|
|
|
success {
|
2018-07-16 19:11:41 +02:00
|
|
|
archiveArtifacts artifacts: '**/target/*.jar', excludes: '**/target/*-noshade.jar', fingerprint: true
|
2018-07-16 18:55:31 +02:00
|
|
|
step([
|
|
|
|
$class: 'JavadocArchiver',
|
|
|
|
javadocDir: 'target/apidocs',
|
|
|
|
keepAll: true
|
|
|
|
])
|
2018-07-16 20:03:18 +02:00
|
|
|
jacoco(execPattern: '**/**.exec', classPattern: '**/classes', sourcePattern: '**/src/main/java')
|
|
|
|
junit 'target/surefire-reports/*.xml'
|
2018-07-16 18:55:31 +02:00
|
|
|
}
|
2018-07-16 16:43:38 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
post {
|
|
|
|
always {
|
|
|
|
script {
|
|
|
|
if (env.CI_SKIP == "true") {
|
|
|
|
currentBuild.result = 'NOT_BUILT'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|