jenkins: inline methods
This commit is contained in:
parent
288fbf02f4
commit
4f633f7e72
1 changed files with 7 additions and 13 deletions
20
Jenkinsfile
vendored
20
Jenkinsfile
vendored
|
@ -1,13 +1,3 @@
|
||||||
def maven(goals, modules, profiles) {
|
|
||||||
withMaven(maven: 'maven 3.5.2', jdk: 'JDK 1.8') {
|
|
||||||
sh "mvn -U $profiles $modules $goals"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
def isBranch(branch) {
|
|
||||||
return env.GIT_BRANCH == branch
|
|
||||||
}
|
|
||||||
|
|
||||||
pipeline {
|
pipeline {
|
||||||
agent any
|
agent any
|
||||||
stages {
|
stages {
|
||||||
|
@ -20,13 +10,17 @@ pipeline {
|
||||||
}
|
}
|
||||||
stage('Build') {
|
stage('Build') {
|
||||||
steps {
|
steps {
|
||||||
maven("clean install", ".", "")
|
withMaven(maven: 'maven 3.5.2', jdk: 'JDK 1.8') {
|
||||||
|
sh "mvn -B -U clean install"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
stage('Deploy') {
|
stage('Deploy') {
|
||||||
when { expression { isBranch 'master' } }
|
when { expression { (env.GIT_BRANCH == 'master') } }
|
||||||
steps {
|
steps {
|
||||||
maven("deploy", allModules, "-P release")
|
withMaven(maven: 'maven 3.5.2', jdk: 'JDK 1.8') {
|
||||||
|
sh "mvn -B -U -P release deploy"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue