jenkins: fix syntax

This commit is contained in:
Paul Campbell 2018-03-03 08:53:41 +00:00
parent 4a1311b214
commit b2eda3252a

View file

@ -1,5 +1,6 @@
final String gitRepoUrl = 'git@github.com:kemitix/mon.git' final String gitRepoUrl = 'git@github.com:kemitix/mon.git'
final String mvn = "mvn --batch-mode --update-snapshots" final String mvn = "mvn --batch-mode --update-snapshots"
def pom = readMavenPom file: 'pom.xml'
pipeline { pipeline {
agent any agent any
@ -11,9 +12,8 @@ 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') } when { expression { (env.GIT_BRANCH == 'master') } }
steps { steps {
def pom = readMavenPom file: 'pom.xml'
if ((pom.version).contains("SNAPSHOT")) { if ((pom.version).contains("SNAPSHOT")) {
error("Build failed because SNAPSHOT version: ${pom.groupId}:${pom.artifactId}:${pom.version}") error("Build failed because SNAPSHOT version: ${pom.groupId}:${pom.artifactId}:${pom.version}")
} }