This commit is contained in:
Dan Hawkins 2019-08-12 17:13:33 +01:00
commit a0b6aacddf
2 changed files with 20 additions and 0 deletions

View file

@ -97,4 +97,16 @@ def checkISMfile(String ISMfile) {
}
}
certificatethumbprints = [:]
certificatethumbprints['floreana'] = '0FDEB0A227982C877146CA595091173AC9655479' // Authoring takes place on this machine - so this is what should be in the ISM file already
certificatethumbprints['hawaii'] = '49FD1B361CFF35014B81940C5B046543045DD34B'
def selectSigningCertificate(String nodeName, String ISMfile) {
def masterpattern = '0FDEB0A227982C877146CA595091173AC9655479'
echo "Substituting occurrences of ${masterpattern} with ${certificatethumbprints[nodeName]} in ISM file: ${ISMfile}"
textutils_subst = load("${autobuilder.commonscripts()}/textutils/subst.groovy")
textutils_subst.substitute(ISMfile, masterpattern, certificatethumbprints[nodeName])
}
return this;

8
textutils/subst.groovy Normal file
View file

@ -0,0 +1,8 @@
def substitute(String filepath, String pattern, String subst) {
fileText = readFile(file: filepath, encoding: 'UTF-8')
def converted = fileText.replaceAll(pattern, subst)
writeFile(file: filepath, text: converted, encoding: 'UTF-8')
}
return this;