From: Trevor Bramwell Date: Mon, 21 May 2018 07:47:57 +0000 (-0700) Subject: Fix Manual Triggering of Docker Jobs X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?p=releng.git;a=commitdiff_plain;h=cdd9060386c25a5481244a24e84fd7fc3ab03d90 Fix Manual Triggering of Docker Jobs When manually triggering a docker job (or even through timed builds), GERRIT_EVENT_TYPE will not get set. This does gets set when the job is triggered by a Gerrit event (ex: ref-updated, comment-added). Specifying the variable lookup to default to nothing (ex: "${FOO:-}") should allow non-Gerrit triggered jobs to complete successfully. Change-Id: Ic1ba8ebef0967b0f20a2d6385ce0e0b4876901dc Signed-off-by: Trevor Bramwell --- diff --git a/jjb/releng/opnfv-docker.sh b/jjb/releng/opnfv-docker.sh index c89938b72..70baf16d9 100644 --- a/jjb/releng/opnfv-docker.sh +++ b/jjb/releng/opnfv-docker.sh @@ -83,7 +83,7 @@ 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 +if [[ "${GERRIT_EVENT_TYPE:-}" == "comment-added" ]]; then RELEASE_VERSION=$(echo "$GERRIT_EVENT_COMMENT_TEXT" | grep 'retag' | awk '{print $2}') fi