Supply release tag processing

This commit is contained in:
Dan Hawkins 2022-02-24 22:37:30 +00:00
commit 64882035b9

31
release/tag.groovy Normal file
View file

@ -0,0 +1,31 @@
def LinkedHashMap RELEASETAG_PREFIXES = [
'superceded' : 'Misspelt - Indicates a later release has superseded the release with this prefix',
'superseded' : 'Indicates a later release has superseded the release with this prefix',
'erroneous' : 'The release was released unintentionally',
'faulty' : 'The release was found to have a serious fault',
'ignore' : 'The release should be ignored',
'inmainline' : 'This release was associated with development branch which has now been merged into mainline',
]
def RELEASETAG_PREFIX_SEPERATOR = '_'
def LinkedHashMap startswithspecialprefix(String releasetag) {
def boolean hasspecialprefix = false
def String releasetagprefix = ''
def String prefixfound = ''
def String tagwithoutprefix = releasetag
def rtsplits = releasetag.split(RELEASETAG_PREFIX_SEPERATOR)
if (rtsplits.size() > 0)
prefixfound = rtsplits[0].toLowerCase()
hasspecialprefix = RELEASETAG_PREFIXES.containsKey(prefixfound)
tagwithoutprefix = rtsplits[1..].join(RELEASETAG_PREFIX_SEPERATOR)
}
return [ 'hasspecialprefix' : hasspecialprefix,
'prefixfound' : prefixfound,
'tagwithoutprefix' : tagwithoutprefix,
]
}
return this;