From 1c10bfba373c73007a0ca0cae5cb2ec611bd0f24 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Mon, 8 Apr 2019 18:30:16 +0100 Subject: [PATCH] Perform installer file (ISM) checking --- install/installhelper.groovy | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/install/installhelper.groovy b/install/installhelper.groovy index f3dcdd4..823c117 100644 --- a/install/installhelper.groovy +++ b/install/installhelper.groovy @@ -33,7 +33,8 @@ def placeBinaries(artifactDetails, installerDetails) { @NonCPS def checkISMfile(String ISMfile) { def xml = readFile(ISMfile) - + echo "Checking ISM file: ${ISMfile}" + def parsedxml = new XmlParser(true, true, true).parseText(xml) def pathvariableinfo = [:] def exitcode = 0 @@ -53,24 +54,26 @@ def checkISMfile(String ISMfile) { } // Check that each path variable is defined beginning with a path variable or the WORKSPACE one pathvariableinfo.each{ pair -> - println "pair key: ${pair.key} value: ${pair.value}" + echo "pair key: ${pair.key} value: ${pair.value}" def path = pair.value def pathvarmatcher = path =~ /<(.*)>.*/ if (pathvarmatcher.matches()) { def pathvarfound = pathvarmatcher.group(1) if (pathvarfound != 'WORKSPACE') { if (!pathvariableinfo.containsKey(pathvarfound)) { - println "Undefined path variable ${pathvarfound} found" + echo "Undefined path variable ${pathvarfound} found" exitcode = 1 } } } else { - println "Path: ${path} does not begin with a path variable" + echo "Path: ${path} does not begin with a path variable" exitcode = 1 } } if (exitcode > 0) { error "The ISM file: ${ISMfile} contains a path that is either absolute or does not begin with another path variable definition" + } else { + echo "ISM file: ${ISMfile} - ok" } }