From e7b8dfa910cfc9b55100cb13b56618a1606121a0 Mon Sep 17 00:00:00 2001 From: Isaac Parenteau Date: Sat, 20 Jul 2019 20:36:11 -0500 Subject: [PATCH] Fixed jenkinsfile --- Jenkinsfile | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 2a17299..d3a89f7 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -35,6 +35,7 @@ def init() { job_name = "${env.JOB_NAME}" branch_name = env.BRANCH_NAME branch_name_docker = branch_name.replaceAll(/\//,'.') + persist = "/var/lib/jenkins/PERSIST/${branch_name_docker}" // execute the branch type specific pipeline code try { @@ -53,9 +54,18 @@ def init() { set_result('INPROGRESS') Build() // builds database via flyway migration } + + if (branch_name.indexOf('develop')==0) { + node('master') { + Deploy(); + } + } else if (branch_name.indexOf('release/')==0) { + node('master') { + Deploy(); + } + } node('master') { - // StopContainers() set_result('SUCCESS') } @@ -70,7 +80,6 @@ def init() { def Build() { stage ('build') { mvn "install -DskipTests=true -Dbuild.revision=${git_commit}" - //mvn "$mvn_cmd" step([$class: 'ArtifactArchiver', artifacts: '**/target/*.jar', fingerprint: true]) } } @@ -78,8 +87,6 @@ def Build() { def Initialize() { stage ('initialize') { - // deleteDir() - // get new code checkout scm @@ -143,7 +150,6 @@ def print_vars() { echo "build_type = ${build_type}" echo "display_name = ${currentBuild.displayName}" echo "version = ${version}" - echo "branch_name_docker = ${branch_name_docker}" echo "git_commit = ${git_commit}" }