Handle case of tag not already existing in release repo correctly

This commit is contained in:
Dan Hawkins 2018-12-01 10:47:30 +00:00
commit 467ffd7ac0

View file

@ -137,7 +137,7 @@ def ArrayList<String> maketaglist(String buildstamp, String otherreleasetags) {
def boolean releasegittag(String postcommitshacode, String tag) {
def boolean tagadded = false
// Check if tag exists already
def int gitrevparsestatus = sh(script: "git rev-parse \"${tag}\" > \"${gitrevparseoutputfile}\" 2> /dev/null", returnStatus: true)
def int gitrevparsestatus = sh(script: "git rev-parse \"${tag}\" >\"${gitrevparseoutputfile}\" 2>/dev/null", returnStatus: true)
if (gitrevparsestatus == 0) { // Tag exists
def existingshacode = readFile(file: gitrevparseoutputfile).trim()
if (existingshacode != postcommitshacode) { // If the existing tag is not associated with HEAD