X-Git-Url: https://gerrit.linuxfoundation.org/infra/gitweb?a=blobdiff_plain;f=shell%2Frtd-trigger-build.sh;h=d272c2d7f8e8ec680df5b3b15b4dbf8c274133ad;hb=568b22ef45e66def2e9b3361b3d438fd5b32fd97;hp=6af08d7dfebff6ca382122dd20fc8e4a1774a132;hpb=8709ee5e00526ce3298b92a85a79a7f058d4216b;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)