Chore: Upgrade Jenkins-job-builder to 6.3.0
[releng/global-jjb.git] / shell / rtd-trigger-build.sh
index 30a04ca..e0a6f00 100644 (file)
@@ -8,9 +8,9 @@
 # which accompanies this distribution, and is available at
 # http://www.eclipse.org/legal/epl-v10.html
 ##############################################################################
-# Call cURL to trigger a build in RTD via the Generic API
+# Calls cURL to trigger a build in RTD via the Generic API
 #
-# Paramters:
+# Parameters:
 #     RTD_BUILD_URL: The unique build URL for the project.
 #                    Check Admin > Integrations > Generic API incoming webhook.
 #
@@ -30,13 +30,15 @@ last_char=${RTD_BUILD_URL:length-1:1}
 # 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)
 
 if [ "$build_triggered" != "true" ]; then
-    echo "ERROR: Build was not triggered."
-    echo "$json" | jq -r
+    echo "ERROR: Build was not triggered, ReadTheDocs response follows:"
+    echo "$json"
     exit 1
 fi
 
 echo "Build triggered for $GERRIT_PROJECT in ReadTheDocs."
+echo "---> rtd-trigger-build.sh ends"