X-Git-Url: https://gerrit.linuxfoundation.org/infra/gitweb?a=blobdiff_plain;f=shell%2Frtd-trigger-build.sh;h=d272c2d7f8e8ec680df5b3b15b4dbf8c274133ad;hb=e1a8dc64cfe10360ebdcadd28806adf800760ce7;hp=6af08d7dfebff6ca382122dd20fc8e4a1774a132;hpb=dbd05cd4100a27a545cc2c7f0388018449d982c3;p=releng%2Fglobal-jjb.git diff --git a/shell/rtd-trigger-build.sh b/shell/rtd-trigger-build.sh index 6af08d7d..d272c2d7 100644 --- a/shell/rtd-trigger-build.sh +++ b/shell/rtd-trigger-build.sh @@ -27,6 +27,10 @@ set -e -o pipefail 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##*/} + +echo "INFO: Posting request for branch $GERRIT_BRANCH to URL $RTD_BUILD_URL" json=$(curl -X POST -d "branches=${GERRIT_BRANCH}" -d "token=$RTD_TOKEN" "$RTD_BUILD_URL") build_triggered=$(echo "$json" | jq -r .build_triggered)