Add a new meta walker and test it
This commit is contained in:
parent
9b773dd0c5
commit
e21cbf4d03
1 changed files with 23 additions and 1 deletions
|
|
@ -8,8 +8,30 @@ def check(buildmeta) {
|
|||
// Walk the meta looking for different versions of the same components
|
||||
def allmeta = buildmeta.allrelatedmeta()
|
||||
echo "All meta:\n${allmeta.comment}"
|
||||
|
||||
def productcomponents = [:]
|
||||
for (meta in allmeta.metacollection) {
|
||||
echo meta.componentversionuniqueidentifier()
|
||||
def key = meta.componentidentifier()
|
||||
|
||||
if (!productcomponents.containsKey(key)) {
|
||||
productcomponents[key] = [:]
|
||||
}
|
||||
def buildstampnumber = meta.releasetag()
|
||||
if (!productcomponents[key].containsKey(buildstampnumber)) {
|
||||
productcomponents[key][buildstampnumber] = 1
|
||||
} else {
|
||||
productcomponents[key][buildstampnumber] += 1
|
||||
}
|
||||
}
|
||||
for (pc in productcomponents.keySet()) {
|
||||
bsns = productcomponents[pc]
|
||||
if (bsns.size() > 1) {
|
||||
results.good = false
|
||||
results.comment += "There is more than one version of Product component: ${pc} being used in this build:\n"
|
||||
for (bsn in bsns.keySet()) {
|
||||
comment += "${bsn}\n"
|
||||
}
|
||||
}
|
||||
}
|
||||
return results
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue