From 5a4e78947576e38d2bf858ae9c29a827ebe66869 Mon Sep 17 00:00:00 2001 From: Nana Janashia Date: Sat, 7 Nov 2020 15:44:58 +0000 Subject: [PATCH] Update Jenkinsfile --- Jenkinsfile | 71 +++++++++++++++++++++++++++-------------------------- 1 file changed, 36 insertions(+), 35 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index e22f659..8b55f4c 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,37 +1,38 @@ +def gv + pipeline { - agent none - stages { - stage('test') { - steps { - script { - echo "Testing the application..." - echo "Executing pipeline for branch $BRANCH_NAME" - } - } - } - stage('build') { - when { - expression { - BRANCH_NAME == 'master' - } - } - steps { - script { - echo "Building the application..." - } - } - } - stage('deploy') { - when { - expression { - BRANCH_NAME == 'master' - } - } - steps { - script { - echo "Deploying the application..." - } - } - } + agent any + tools { + maven 'Maven' } -} + stages { + stage("init") { + steps { + script { + gv = load "script.groovy" + } + } + } + stage("build jar") { + steps { + script { + gv.buildJar() + } + } + } + stage("build image") { + steps { + script { + gv.buildImage() + } + } + } + stage("deploy") { + steps { + script { + gv.deployApp() + } + } + } + } +} \ No newline at end of file