From 4f633f7e72038fe33e09ecd999114742d056b5e0 Mon Sep 17 00:00:00 2001 From: Paul Campbell Date: Tue, 27 Feb 2018 06:55:23 +0000 Subject: [PATCH] jenkins: inline methods --- Jenkinsfile | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index d43fdd7..65449e8 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -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 { agent any stages { @@ -20,13 +10,17 @@ pipeline { } stage('Build') { steps { - maven("clean install", ".", "") + withMaven(maven: 'maven 3.5.2', jdk: 'JDK 1.8') { + sh "mvn -B -U clean install" + } } } stage('Deploy') { - when { expression { isBranch 'master' } } + when { expression { (env.GIT_BRANCH == 'master') } } steps { - maven("deploy", allModules, "-P release") + withMaven(maven: 'maven 3.5.2', jdk: 'JDK 1.8') { + sh "mvn -B -U -P release deploy" + } } } }