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

This commit is contained in:
Dan Hawkins 2018-12-01 15:00:02 +00:00
commit 5e7a447a10

View file

@ -32,11 +32,11 @@ 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)
def int pstatus = script.sh(script: "git check-ref-format --normalize \"refs/tags/${productname}\" >/dev/null 2>/dev/null", , 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)
def int sstatus = script.sh(script: "git check-ref-format --normalize \"refs/tags/${subcomponentname}\" >/dev/null 2>/dev/null", , 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")
}