jenkins: fix syntax #2
This commit is contained in:
parent
b2eda3252a
commit
c074b6e549
1 changed files with 7 additions and 4 deletions
|
@ -12,11 +12,14 @@ pipeline {
|
||||||
}
|
}
|
||||||
stage('no SNAPSHOT in master') {
|
stage('no SNAPSHOT in master') {
|
||||||
// checks that the pom version is not a snapshot when the current branch is master
|
// checks that the pom version is not a snapshot when the current branch is master
|
||||||
when { expression { (env.GIT_BRANCH == 'master') } }
|
// TODO: also check for SNAPSHOT when is a pull request with master as the target branch
|
||||||
steps {
|
when {
|
||||||
if ((pom.version).contains("SNAPSHOT")) {
|
expression {
|
||||||
error("Build failed because SNAPSHOT version: ${pom.groupId}:${pom.artifactId}:${pom.version}")
|
(env.GIT_BRANCH == 'master') &&
|
||||||
|
(pom.version).contains("SNAPSHOT") }
|
||||||
}
|
}
|
||||||
|
steps {
|
||||||
|
error("Build failed because SNAPSHOT version: ${pom.groupId}:${pom.artifactId}:${pom.version}")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
stage('Build') {
|
stage('Build') {
|
||||||
|
|
Loading…
Reference in a new issue