AuthMeReloaded/Jenkinsfile

86 lines
2.2 KiB
Plaintext
Raw Normal View History

2018-07-16 16:43:38 +02:00
pipeline {
agent {
docker {
image 'sgdc3/maven-argon2:3.5.4-jdk-10'
2018-07-16 16:43:38 +02:00
args '-v $HOME/.m2:/root/.m2'
}
}
options {
timeout(time: 8, unit: 'MINUTES')
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'
}
}
2018-07-16 16:43:38 +02:00
stage ('Build') {
2018-07-16 18:55:31 +02:00
when {
2018-07-16 18:56:49 +02:00
not {
branch "master"
}
2018-07-16 18:55:31 +02:00
}
2018-07-16 16:43:38 +02:00
steps {
sh 'mvn -B clean package'
}
post {
success {
2018-07-16 19:11:41 +02:00
archiveArtifacts artifacts: '**/target/*.jar', excludes: '**/target/*-noshade.jar', fingerprint: true
2018-07-16 16:43:38 +02:00
}
}
}
2018-07-16 18:55:31 +02:00
stage ('Build & Deploy') {
2018-07-16 16:43:38 +02:00
when {
branch "master"
}
steps {
2018-07-16 18:55:31 +02:00
sh 'mvn -B clean package javadoc:aggregate-jar source:jar deploy'
}
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 16:43:38 +02:00
}
}
}
post {
always {
script {
if (env.CI_SKIP == "true") {
currentBuild.result = 'NOT_BUILT'
}
}
}
2018-07-16 19:11:41 +02:00
success {
githubNotify description: 'The jenkins build was successful', status: 'SUCCESS'
}
failure {
githubNotify description: 'The jenkins build failed', status: 'FAILURE'
}
2018-07-16 16:43:38 +02:00
}
}