Perform installer file (ISM) checking
This commit is contained in:
parent
1fce006fe3
commit
865deaecf8
1 changed files with 7 additions and 4 deletions
|
|
@ -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"
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue