Handle case of tag not already existing in release repo correctly
This commit is contained in:
parent
483c6ee630
commit
72072efecb
1 changed files with 3 additions and 3 deletions
|
|
@ -137,7 +137,7 @@ def ArrayList<String> maketaglist(String buildstamp, String otherreleasetags) {
|
||||||
def boolean releasegittag(String postcommitshacode, String tag) {
|
def boolean releasegittag(String postcommitshacode, String tag) {
|
||||||
def boolean tagadded = false
|
def boolean tagadded = false
|
||||||
// Check if tag exists already
|
// Check if tag exists already
|
||||||
def int gitrevparsestatus = sh(script: "git rev-parse \"${tag}\" > \"${gitrevparseoutputfile}\"", returnStatus: true)
|
def int gitrevparsestatus = sh(script: "git rev-parse \"${tag}\" > \"${gitrevparseoutputfile}\" 2> /dev/null", returnStatus: true)
|
||||||
if (gitrevparsestatus == 0) { // Tag exists
|
if (gitrevparsestatus == 0) { // Tag exists
|
||||||
def existingshacode = readFile(file: gitrevparseoutputfile).trim()
|
def existingshacode = readFile(file: gitrevparseoutputfile).trim()
|
||||||
if (existingshacode != postcommitshacode) { // If the existing tag is not associated with HEAD
|
if (existingshacode != postcommitshacode) { // If the existing tag is not associated with HEAD
|
||||||
|
|
@ -173,12 +173,12 @@ def boolean releasegittags(String postcommitshacode, ArrayList<String> taglist)
|
||||||
def releasegitpush(String dryrunpush ) {
|
def releasegitpush(String dryrunpush ) {
|
||||||
if (dryrunpush == "true") {
|
if (dryrunpush == "true") {
|
||||||
sh("git push -n --tags origin master")
|
sh("git push -n --tags origin master")
|
||||||
summaryappend("Dry-Run-Push")
|
summaryappend(",Dry-Run-Push")
|
||||||
setunstable("The artifact(s) have not been pushed/saved (\"Dry run push\" parameter/option is selected)")
|
setunstable("The artifact(s) have not been pushed/saved (\"Dry run push\" parameter/option is selected)")
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
sh("git push --tags origin master")
|
sh("git push --tags origin master")
|
||||||
summaryappend("Push")
|
summaryappend(",Push")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue