From 8bf5b8d81fb50bf5a166a95d6e79bc26a0b5b68a Mon Sep 17 00:00:00 2001 From: "SLW\\ARNAUA" Date: Thu, 9 Mar 2023 12:50:27 +0100 Subject: [PATCH] modified --- Jenkinsfile | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index aaf400d..2e95cf3 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -77,11 +77,11 @@ steps{ script { def now = new Date() - def timestamp = now.format("yyMMdd-HHmm", TimeZone.getTimeZone('UTC')) - println timestamp - def branch = timestamp+"-automatedSLOGeneration" + env.timestamp = now.format("yyMMdd-HHmm", TimeZone.getTimeZone('UTC')) + println env.timestamp + env.branch = env.timestamp+"-automatedSLOGeneration" dir("/opt/workspace/coco_terraform_config/") { - sh "git checkout -b \"${branch}\"" + sh "git checkout -b \"${env.branch}\"" } } } @@ -124,8 +124,8 @@ script { dir("/opt/workspace/coco_terraform_config/") { sh "git add ." - sh "git commit -m \"${timestamp}\"" - sh "git push origin ${branch}" + sh "git commit -m \"${env.timestamp}\"" + sh "git push origin ${env.branch}" } } }