jenkins: add check to fail build when SNAPSHOT on master branch
This commit is contained in:
parent
463d633ed9
commit
e6e022381c
1 changed files with 10 additions and 0 deletions
|
@ -9,6 +9,16 @@ pipeline {
|
||||||
git url: gitRepoUrl, branch: '**', credentialsId: 'github-kemitix'
|
git url: gitRepoUrl, branch: '**', credentialsId: 'github-kemitix'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
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 {
|
||||||
|
def pom = readMavenPom file: 'pom.xml'
|
||||||
|
if ((pom.version).contains("SNAPSHOT")) {
|
||||||
|
error("Build failed because SNAPSHOT version: ${pom.groupId}:${pom.artifactId}:${pom.version}")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
stage('Build') {
|
stage('Build') {
|
||||||
parallel {
|
parallel {
|
||||||
stage('Java 8') {
|
stage('Java 8') {
|
||||||
|
|
Loading…
Reference in a new issue