summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTrevor Bramwell <tbramwell@linuxfoundation.org>2018-05-01 16:10:14 -0700
committerTrevor Bramwell <tbramwell@linuxfoundation.org>2018-05-17 16:03:27 -0700
commitc038e447f30b2ade6b0f0b4ee9e7f2a21dd5b056 (patch)
treee4e0b61f36892294787d55916fea57d6e57f8212
parent5224551580e0ef572a0b95b08eb7ceb67b1fe5fc (diff)
Fix Docker Container Build Tagging
Builds triggered by tags have a typo in the extraction of the tag name. This change includes a method for retriggering a tag build with the comment "retag TAG_NAME". Change-Id: Ie035e0922f8c073d3e360917ea7ccd6fa76d7b20 Signed-off-by: Trevor Bramwell <tbramwell@linuxfoundation.org>
-rw-r--r--jjb/releng/opnfv-docker.sh9
1 files changed, 8 insertions, 1 deletions
diff --git a/jjb/releng/opnfv-docker.sh b/jjb/releng/opnfv-docker.sh
index 5c8cafbe3..c89938b72 100644
--- a/jjb/releng/opnfv-docker.sh
+++ b/jjb/releng/opnfv-docker.sh
@@ -78,7 +78,14 @@ echo "Current branch: $BRANCH"
BUILD_BRANCH=$BRANCH
GERRIT_REFNAME=${GERRIT_REFNAME:-''}
-RELEASE_VERSION=${GERRIT_REFNAME/refs\/tags//}
+RELEASE_VERSION=${GERRIT_REFNAME/refs\/tags\/}
+
+# If we're being triggered by a comment-added job, then extract the tag
+# from the comment and use that as the release version.
+# Expected comment format: retag opnfv-x.y.z
+if [[ "$GERRIT_EVENT_TYPE" == "comment-added" ]]; then
+ RELEASE_VERSION=$(echo "$GERRIT_EVENT_COMMENT_TEXT" | grep 'retag' | awk '{print $2}')
+fi
if [[ "$BRANCH" == "master" ]]; then
DOCKER_TAG="latest"