This commit is contained in:
Dan Hawkins 2019-04-21 11:50:51 +01:00
commit 73c02fb8eb
2 changed files with 64 additions and 1 deletions

View file

@ -30,4 +30,58 @@ def placeBinaries(artifactDetails, installerDetails) {
}
}
return this;
@NonCPS
def checkISMfilebackend(String xml) {
def String message = ""
def parsedxml = new XmlParser(true, true, true).parseText(xml)
def pathvariableinfo = [:]
def exitcode = 0
// Load up a map of path variable and path pairs
// Ignore blank path definitions
// Ignore the workspace definition which should have the only absolute path
parsedxml.each{ table ->
if (table.@name == "ISPathVariable") {
table['row'].each{ row ->
def pathname = row['td'][0].value()[0]
def path = row['td'][1].value()[0]
if (path && pathname != 'WORKSPACE') {
pathvariableinfo[pathname] = path
}
}
}
}
// Check that each path variable is defined beginning with a path variable or the WORKSPACE one
pathvariableinfo.each{ pair ->
message += "pair key: ${pair.key} value: ${pair.value}\n"
def path = pair.value
def pathvarmatcher = path =~ /<(.*)>.*/
if (pathvarmatcher.matches()) {
def pathvarfound = pathvarmatcher.group(1)
if (pathvarfound != 'WORKSPACE') {
if (!pathvariableinfo.containsKey(pathvarfound)) {
message += "Undefined path variable ${pathvarfound} found\n"
exitcode = 1
}
}
} else {
message += "Path: ${path} does not begin with a path variable\n"
exitcode = 1
}
}
return [exitcode, message]
}
def checkISMfile(String ISMfile) {
echo "Checking ISM file: ${ISMfile}"
def xml = readFile(ISMfile)
(exitcode, message) = checkISMfilebackend(xml)
echo message
if (exitcode > 0) {
error "ISM file errors found"
} else {
echo "Checked ISM file - ok"
}
}
return this;

View file

@ -655,6 +655,10 @@ class MetaInfo extends GISJsonSerialised {
return METAFOLDERNAME
}
static String difffolder() {
return DIFFFOLDERNAME
}
String generateartifacts(ArrayList<String> releasedfromhere = new ArrayList<String>(), // These items are recorded in meta as released from here
ArrayList<String> releasedfromsubmeta = new ArrayList<String>(), // These items are not recorded in meta as released from here
String metafilepath ="${METAFOLDERNAME}/${METAFILENAME}"
@ -763,6 +767,11 @@ MetaInfo metareset(script) {
dir(mi.folder()) {
deleteDir()
}
dir(mi.difffolder()) {
deleteDir()
}
return mi
}