2020-10-03 11:34:56 +02:00
|
|
|
#!/usr/bin/env groovy
|
|
|
|
// see https://jenkins.io/doc/book/pipeline/syntax/
|
|
|
|
|
|
|
|
pipeline {
|
2020-10-03 14:18:38 +02:00
|
|
|
environment {
|
|
|
|
MVN_SET = credentials('maven_settings')
|
|
|
|
JAVA_TOOL_OPTIONS = '-Duser.home=/var/maven'
|
|
|
|
}
|
|
|
|
agent {
|
|
|
|
docker {
|
|
|
|
image 'maven:3.6.3'
|
|
|
|
args '-v $HOME:/var/maven'
|
|
|
|
reuseNode true
|
2020-10-03 14:15:58 +02:00
|
|
|
}
|
2020-10-03 14:18:38 +02:00
|
|
|
}
|
|
|
|
triggers {
|
|
|
|
pollSCM "* * * * *"
|
|
|
|
}
|
|
|
|
options {
|
|
|
|
timestamps()
|
|
|
|
ansiColor("xterm")
|
|
|
|
}
|
|
|
|
parameters {
|
|
|
|
booleanParam(name: "RELEASE",
|
|
|
|
description: "Build a release from current commit.",
|
|
|
|
defaultValue: false)
|
|
|
|
}
|
|
|
|
stages {
|
|
|
|
stage("Compile C++") {
|
|
|
|
steps {
|
|
|
|
sh "./jenkins/scripts/compile.sh"
|
|
|
|
JAVA_TOOL_OPTIONS = '-Duser.home=/var/maven'
|
2020-10-03 14:15:58 +02:00
|
|
|
}
|
|
|
|
}
|
2020-10-03 14:08:38 +02:00
|
|
|
|
2020-10-03 14:18:38 +02:00
|
|
|
stage("Build & Deploy SNAPSHOT") {
|
|
|
|
steps {
|
|
|
|
sh "mvn -s $MVN_SET -B deploy"
|
|
|
|
}
|
|
|
|
}
|
2020-10-03 11:34:56 +02:00
|
|
|
|
2020-10-03 14:18:38 +02:00
|
|
|
stage("Release") {
|
|
|
|
when {
|
|
|
|
expression { params.RELEASE }
|
|
|
|
}
|
|
|
|
steps {
|
|
|
|
sh "mvn -s $MVN_SET -B release:prepare"
|
|
|
|
sh "mvn -s $MVN_SET -B release:perform"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
stage('Deliver') {
|
|
|
|
steps {
|
|
|
|
sh './jenkins/scripts/deliver.sh'
|
|
|
|
}
|
2020-10-03 14:15:58 +02:00
|
|
|
}
|
2020-10-03 14:18:38 +02:00
|
|
|
}
|
|
|
|
post {
|
|
|
|
always {
|
|
|
|
deleteDir()
|
2020-10-03 14:15:58 +02:00
|
|
|
}
|
2020-10-03 14:18:38 +02:00
|
|
|
}
|
2020-10-03 11:34:56 +02:00
|
|
|
}
|