AuthMeReloaded/Jenkinsfile

73 lines
2.1 KiB
Plaintext
Raw Normal View History

2018-07-16 16:43:38 +02:00
pipeline {
agent {
2018-07-18 12:45:27 +02:00
label 'argon2'
}
2018-07-16 16:43:38 +02:00
options {
2018-07-16 19:14:52 +02:00
timeout(time: 5, unit: 'MINUTES')
2018-07-16 16:43:38 +02:00
timestamps()
}
2018-07-16 20:09:23 +02:00
triggers {
githubPush()
}
2018-07-16 16:43:38 +02:00
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-18 13:00:57 +02:00
withMaven(
2018-07-18 13:09:07 +02:00
jdk 'OracleJDK 8',
maven: 'Maven 3',
globalMavenSettingsConfig: 'e5b005b5-be4d-4709-8657-1981662bcbe3',
2018-07-18 13:00:57 +02:00
mavenOpts: '-Xmx4G'
) {
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 20:03:18 +02:00
}
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'
}
}
}
}
}