Update Jenkinsfile

This commit is contained in:
Nana Janashia
2020-11-07 15:44:58 +00:00
parent 9969d8b2cf
commit 5a4e789475

37
Jenkinsfile vendored
View File

@@ -1,35 +1,36 @@
def gv
pipeline { pipeline {
agent none agent any
tools {
maven 'Maven'
}
stages { stages {
stage('test') { stage("init") {
steps { steps {
script { script {
echo "Testing the application..." gv = load "script.groovy"
echo "Executing pipeline for branch $BRANCH_NAME"
} }
} }
} }
stage('build') { stage("build jar") {
when {
expression {
BRANCH_NAME == 'master'
}
}
steps { steps {
script { script {
echo "Building the application..." gv.buildJar()
} }
} }
} }
stage('deploy') { stage("build image") {
when {
expression {
BRANCH_NAME == 'master'
}
}
steps { steps {
script { script {
echo "Deploying the application..." gv.buildImage()
}
}
}
stage("deploy") {
steps {
script {
gv.deployApp()
} }
} }
} }