From 273c10f0415eb31c94e0f11adb8e28d2868b9143 Mon Sep 17 00:00:00 2001 From: Nana Janashia Date: Thu, 5 Nov 2020 17:47:23 +0000 Subject: [PATCH] Update Jenkinsfile --- Jenkinsfile | 35 ++++++++++++++++++++--------------- 1 file changed, 20 insertions(+), 15 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 89cf390..64ec416 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,39 +1,44 @@ -pipeline { +def gv +pipeline { agent any - parameters { choice(name: 'VERSION', choices: ['1.1.0', '1.2.0', '1.3.0'], description: '') booleanParam(name: 'executeTests', defaultValue: true, description: '') } stages { - - stage("build") { - + stage("init") { steps { - echo 'building the application...' + script { + gv = load "script.groovy" + } + } + } + stage("build") { + steps { + script { + gv.buildApp() + } } } - stage("test") { - when { expression { params.executeTests } } steps { - echo 'testing the application...' + script { + gv.testApp() + } } } - stage("deploy") { - steps { - echo 'deplying the application...' - echo "deploying version ${params.VERSION}" + script { + gv.deployApp() + } } } } -} - +} \ No newline at end of file