From 7a860b21c2a5a43e04a54e6b975251dc88c0e42c Mon Sep 17 00:00:00 2001 From: Carl Kittelberger Date: Mon, 7 May 2018 20:49:32 +0200 Subject: [PATCH] Clean up directory where version meta is unpacked to before using. --- Jenkinsfile | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 9a0b5f8..3dfb94a 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -26,15 +26,18 @@ node("docker && linux && amd64") { "--build-arg TOMCAT_VERSION=${tomcatVersion} --build-arg TOMCAT_JRE=${jreVersion} .") def guacamoleVersion - image.inside("-w /tmp") { + image.inside() { ansiColor { - sh """ - unzip /opt/guacamole/guacamole.war META-INF/maven/org.apache.guacamole/guacamole/pom.properties - """ - guacamoleVersion = sh( - script: "grep -Po '(?i)^version=\\K.+\\s*\$' META-INF/maven/org.apache.guacamole/guacamole/pom.properties", - returnStdout: true, - ).trim() + dir("tmp") { + deleteDir() + sh """ + unzip /opt/guacamole/guacamole.war META-INF/maven/org.apache.guacamole/guacamole/pom.properties + """ + guacamoleVersion = sh( + script: "grep -Po '(?i)^version=\\K.+\\s*\$' META-INF/maven/org.apache.guacamole/guacamole/pom.properties", + returnStdout: true, + ).trim() + } } } }