Make sure product name and sub component names can be used in tags

This commit is contained in:
Dan Hawkins 2018-12-01 14:52:01 +00:00
commit f4688da007

View file

@ -31,6 +31,15 @@ class ProductInfo extends GISJsonSerialised {
}
void set(String productname, String subcomponentname, String jirakey) {
// Make sure the fields can be used in git tags
def int pstatus = script.sh(script: "git check-ref-format --normalize \"refs/tags/${productname}\"", , returnStatus: true)
if (pstatus > 0) {
script.error("The product name: ${productname} needs to be renamed as it cannot be used in a git tag name")
}
def int sstatus = script.sh(script: "git check-ref-format --normalize \"refs/tags/${subcomponentname}\"", , returnStatus: true)
if (sstatus > 0) {
script.error("The subcomponent name: ${subcomponentname} needs to be renamed as it cannot be used in a git tag name")
}
this.productname = productname
this.subcomponentname = subcomponentname
this.jirakey = jirakey