1
0

Update Jenkinsfile

This commit is contained in:
Andrea Cavalli 2020-10-03 14:18:38 +02:00
parent cecfca8d6d
commit 648ca714b1

103
Jenkinsfile vendored
View File

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