Fixed jenkinsfile
This commit is contained in:
16
Jenkinsfile
vendored
16
Jenkinsfile
vendored
@ -35,6 +35,7 @@ def init() {
|
|||||||
job_name = "${env.JOB_NAME}"
|
job_name = "${env.JOB_NAME}"
|
||||||
branch_name = env.BRANCH_NAME
|
branch_name = env.BRANCH_NAME
|
||||||
branch_name_docker = branch_name.replaceAll(/\//,'.')
|
branch_name_docker = branch_name.replaceAll(/\//,'.')
|
||||||
|
persist = "/var/lib/jenkins/PERSIST/${branch_name_docker}"
|
||||||
|
|
||||||
// execute the branch type specific pipeline code
|
// execute the branch type specific pipeline code
|
||||||
try {
|
try {
|
||||||
@ -54,8 +55,17 @@ def init() {
|
|||||||
Build() // builds database via flyway migration
|
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') {
|
node('master') {
|
||||||
// StopContainers()
|
|
||||||
set_result('SUCCESS')
|
set_result('SUCCESS')
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -70,7 +80,6 @@ def init() {
|
|||||||
def Build() {
|
def Build() {
|
||||||
stage ('build') {
|
stage ('build') {
|
||||||
mvn "install -DskipTests=true -Dbuild.revision=${git_commit}"
|
mvn "install -DskipTests=true -Dbuild.revision=${git_commit}"
|
||||||
//mvn "$mvn_cmd"
|
|
||||||
step([$class: 'ArtifactArchiver', artifacts: '**/target/*.jar', fingerprint: true])
|
step([$class: 'ArtifactArchiver', artifacts: '**/target/*.jar', fingerprint: true])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -78,8 +87,6 @@ def Build() {
|
|||||||
def Initialize() {
|
def Initialize() {
|
||||||
stage ('initialize') {
|
stage ('initialize') {
|
||||||
|
|
||||||
// deleteDir()
|
|
||||||
|
|
||||||
// get new code
|
// get new code
|
||||||
checkout scm
|
checkout scm
|
||||||
|
|
||||||
@ -143,7 +150,6 @@ def print_vars() {
|
|||||||
echo "build_type = ${build_type}"
|
echo "build_type = ${build_type}"
|
||||||
echo "display_name = ${currentBuild.displayName}"
|
echo "display_name = ${currentBuild.displayName}"
|
||||||
echo "version = ${version}"
|
echo "version = ${version}"
|
||||||
echo "branch_name_docker = ${branch_name_docker}"
|
|
||||||
echo "git_commit = ${git_commit}"
|
echo "git_commit = ${git_commit}"
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user