jenkins: fix syntax #4
This commit is contained in:
parent
d6564cef08
commit
08e051799d
1 changed files with 2 additions and 2 deletions
|
@ -12,13 +12,13 @@ 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
|
||||||
// TODO: also check for SNAPSHOT when is a pull request with master as the target branch
|
// TODO: also check for SNAPSHOT when is a pull request with master as the target branch
|
||||||
final Model pom = readMavenPom file: 'pom.xml'
|
|
||||||
when {
|
when {
|
||||||
expression {
|
expression {
|
||||||
(env.GIT_BRANCH == 'master') &&
|
(env.GIT_BRANCH == 'master') &&
|
||||||
(pom.version).contains("SNAPSHOT") }
|
(readMavenPom(file: 'pom.xml').version).contains("SNAPSHOT") }
|
||||||
}
|
}
|
||||||
steps {
|
steps {
|
||||||
|
def pom = readMavenPom(file: 'pom.xml')
|
||||||
error("Build failed because SNAPSHOT version: ${pom.groupId}:${pom.artifactId}:${pom.version}")
|
error("Build failed because SNAPSHOT version: ${pom.groupId}:${pom.artifactId}:${pom.version}")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue