Skip to content

Commit

Permalink
add choose ditto version again;
Browse files Browse the repository at this point in the history
Signed-off-by: Stefan Maute <stefan.maute@bosch.io>
  • Loading branch information
stmaute committed Jul 1, 2020
1 parent 9006149 commit 66935d3
Showing 1 changed file with 23 additions and 5 deletions.
28 changes: 23 additions & 5 deletions java/Jenkinsfile_multibranch_pipeline
Expand Up @@ -14,12 +14,18 @@ pipeline {
disableConcurrentBuilds()
}
parameters {
string(name: 'dittoVersion', defaultValue: "${dittoVersion}", description: 'Branch')
string(name: 'DOCKER_ARGS_FOR_BUILD', defaultValue: '', description: 'Docker args for building the ditto project inside the container')
string(name: 'DOCKER_ARGS_FOR_SONAR', defaultValue: '', description: 'Docker args for SonarScan stage')
string(name: 'DOCKER_IMAGE_MAVEN_JDK_8', defaultValue: '', description: 'Insert the docker image version to run the build')
string(name: 'DITTO_DOCKER_ARGS', defaultValue: '', description: 'Docker args for building the ditto project inside the container')
string(name: 'DITTO_DOCKER_IMAGE_MAVEN_JDK_8', defaultValue: '', description: 'Insert the docker image version to run the build')
}
stages {
stage('Choose Ditto Version to build against') {
steps {
script {
dittoVersion = askForDittoVersionToUse(dittoVersion)
echo "Selected Ditto version: ${dittoVersion}"
}
}
}
stage('Checkout scm') {
agent {
label 'docker-slave'
Expand All @@ -43,7 +49,7 @@ pipeline {
" --batch-mode --errors" +
" -DcreateJavadoc=true" +
" -Drevision=${theVersion}" +
" -Dditto.version=${params.dittoVersion}" +
" -Dditto.version=${dittoVersion}" +
" -Pditto-java-client"
}
}
Expand All @@ -69,4 +75,16 @@ pipeline {
}
}
}
}

def askForDittoVersionToUse(defaultVersion) {
try {
timeout(time: 1, unit: 'MINUTES') {
def branch = input message: 'Which Ditto version to use?',
parameters: [string(defaultValue: defaultVersion, description: 'Branch', name: 'DITTO-BRANCH')]
return branch
}
} catch (e) {
return defaultVersion
}
}

0 comments on commit 66935d3

Please sign in to comment.