jenkins: checkfor SNAPSHOT when pull request into master
This commit is contained in:
parent
586546f615
commit
997e08458e
1 changed files with 3 additions and 4 deletions
|
@ -3,17 +3,16 @@ final String mvn = "mvn --batch-mode --update-snapshots"
|
||||||
pipeline {
|
pipeline {
|
||||||
agent any
|
agent any
|
||||||
stages {
|
stages {
|
||||||
stage('dump environment') {
|
stage('Environment') {
|
||||||
steps {
|
steps {
|
||||||
sh 'set'
|
sh 'set'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
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 or target branch is master
|
||||||
// TODO: also check for SNAPSHOT when is a pull request with master as the target branch
|
|
||||||
when {
|
when {
|
||||||
expression {
|
expression {
|
||||||
(env.GIT_BRANCH == 'master') &&
|
(env.GIT_BRANCH == 'master' || env.CHANGE_TARGET == 'master') &&
|
||||||
(readMavenPom(file: 'pom.xml').version).contains("SNAPSHOT") }
|
(readMavenPom(file: 'pom.xml').version).contains("SNAPSHOT") }
|
||||||
}
|
}
|
||||||
steps {
|
steps {
|
||||||
|
|
Loading…
Reference in a new issue