Issue: RELENG-2445
Change-Id: I83bbb8b5b44ae6aee8e9cafd1711e8ac19b48811
Signed-off-by: Anil Belur <abelur@linuxfoundation.org>
--- /dev/null
+---
+fixes:
+ - |
+ Fix rtd merge job to handle case of a new tag upload. When a new tag is
+ pushed this sets the gerrit event type to "ref-updated", and sets the
+ `branch=*` which is invalid. The change handles the case of tag update
+ and builds against the appropriate branch for that tag.
last_char=${RTD_BUILD_URL:length-1:1}
[[ $last_char != "/" ]] && RTD_BUILD_URL="$RTD_BUILD_URL/"; :
+# Handle case for gerrit event type is ref-updated when new tag are pushed
+[[ $GERRIT_EVENT_TYPE =~ "ref-updated" ]] && GERRIT_BRANCH=${GERRIT_REFNAME##*/}
+
json=$(curl -X POST -d "branches=${GERRIT_BRANCH}" -d "token=$RTD_TOKEN" "$RTD_BUILD_URL")
build_triggered=$(echo "$json" | jq -r .build_triggered)