From e02d609283aa6f14a0b1498f18b6cc45ca021a14 Mon Sep 17 00:00:00 2001 From: Dan Hawkins Date: Sat, 1 Dec 2018 14:52:01 +0000 Subject: [PATCH] Make sure product name and sub component names can be used in tags --- meta/folder.groovy | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/meta/folder.groovy b/meta/folder.groovy index 13b1fe5..7ab5744 100644 --- a/meta/folder.groovy +++ b/meta/folder.groovy @@ -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