jenkins: fix syntax #2

This commit is contained in:
Paul Campbell 2018-03-03 09:03:35 +00:00
parent 2d74af9c85
commit ba64654097

View file

@ -12,11 +12,14 @@ pipeline {
}
stage('no SNAPSHOT in master') {
// checks that the pom version is not a snapshot when the current branch is master
when { expression { (env.GIT_BRANCH == 'master') } }
steps {
if ((pom.version).contains("SNAPSHOT")) {
error("Build failed because SNAPSHOT version: ${pom.groupId}:${pom.artifactId}:${pom.version}")
// TODO: also check for SNAPSHOT when is a pull request with master as the target branch
when {
expression {
(env.GIT_BRANCH == 'master') &&
(pom.version).contains("SNAPSHOT") }
}
steps {
error("Build failed because SNAPSHOT version: ${pom.groupId}:${pom.artifactId}:${pom.version}")
}
}
stage('Build') {