Update Jenkinsfile
This commit is contained in:
37
Jenkinsfile
vendored
37
Jenkinsfile
vendored
@@ -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()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user