Fixed jenkinsfile

This commit is contained in:
Isaac Parenteau
2019-07-20 20:36:11 -05:00
parent 79529ecc40
commit e7b8dfa910

16
Jenkinsfile vendored
View File

@ -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}"
}