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