From ecc8b71cbe7524d725b72d0fe580a41c27e53c51 Mon Sep 17 00:00:00 2001 From: Roberto Cirillo Date: Wed, 30 Oct 2024 10:41:26 +0100 Subject: [PATCH] add dir function for testing --- Jenkinsfile | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 975cea2..a62797b 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -345,7 +345,12 @@ def deployJobs(def serviceList){ def deploy(String service, String version, String host, String foo){ def now = new Date(); println("Going to deploy the service "+service+" with version: "+version+" on target: "+host+" with argument: "+foo); - def statusCode = sh( script: "${ANSIBLE_ROOT_FOLDER}/CD/deployService.sh $service $version $host $foo;", returnStatus: true); + dir("${ANSIBLE_ROOT_FOLDER}/CD/"){ + sh(""" + git pull; + """) + def statusCode = sh( script: "./deployService.sh $service $version $host $foo;", returnStatus: true); + } sh(""" echo " last exit code \$?"; """)