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 {
agent none
agent any
tools {
maven 'Maven'
}
stages {
stage('test') {
stage("init") {
steps {
script {
echo "Testing the application..."
echo "Executing pipeline for branch $BRANCH_NAME"
gv = load "script.groovy"
}
}
}
stage('build') {
when {
expression {
BRANCH_NAME == 'master'
}
}
stage("build jar") {
steps {
script {
echo "Building the application..."
gv.buildJar()
}
}
}
stage('deploy') {
when {
expression {
BRANCH_NAME == 'master'
}
}
stage("build image") {
steps {
script {
echo "Deploying the application..."
gv.buildImage()
}
}
}
stage("deploy") {
steps {
script {
gv.deployApp()
}
}
}