1
0

Update Jenkinsfile

This commit is contained in:
Andrea Cavalli 2020-10-03 14:15:58 +02:00
parent f06fbfada9
commit cecfca8d6d

102
Jenkinsfile vendored
View File

@ -2,54 +2,62 @@
// see https://jenkins.io/doc/book/pipeline/syntax/ // see https://jenkins.io/doc/book/pipeline/syntax/
pipeline { pipeline {
environment { environment {
MVN_SET = credentials('maven_settings') JAVA_TOOL_OPTIONS = '-Duser.home=/var/maven'
} MVN_SET = credentials('maven_settings')
agent { docker { image 'maven:3.6.3' } } }
triggers { agent {
pollSCM "* * * * *" docker {
} image 'maven:3.6.3'
options { args '-v $HOME:/var/maven'
timestamps() reuseNode true
ansiColor("xterm") }
} }
parameters { triggers {
booleanParam(name: "RELEASE", pollSCM "* * * * *"
description: "Build a release from current commit.", }
defaultValue: false) options {
} timestamps()
stages { ansiColor("xterm")
}
parameters {
booleanParam(name: "RELEASE",
description: "Build a release from current commit.",
defaultValue: false)
}
stages {
stage("Compile C++") { stage("Compile C++") {
steps { steps {
sh "./jenkins/scripts/compile.sh" sh "./jenkins/scripts/compile.sh"
} JAVA_TOOL_OPTIONS = '-Duser.home=/var/maven'
} }
}
stage("Build & Deploy SNAPSHOT") { stage("Build & Deploy SNAPSHOT") {
steps { steps {
sh "mvn -s $MVN_SET -B deploy" sh "mvn -s $MVN_SET -B deploy"
} }
} }
stage("Release") { stage("Release") {
when { when {
expression { params.RELEASE } expression { params.RELEASE }
} }
steps { steps {
sh "mvn -s $MVN_SET -B release:prepare" sh "mvn -s $MVN_SET -B release:prepare"
sh "mvn -s $MVN_SET -B release:perform" sh "mvn -s $MVN_SET -B release:perform"
} }
} }
stage('Deliver') { stage('Deliver') {
steps { steps {
sh './jenkins/scripts/deliver.sh' sh './jenkins/scripts/deliver.sh'
} }
} }
} }
post { post {
always { always {
deleteDir() deleteDir()
} }
} }
} }