From ce75b472866a339cbd8022d44b121449591d995f Mon Sep 17 00:00:00 2001 From: "Lott, Christopher (cl778h)" Date: Tue, 19 May 2020 08:32:15 -0400 Subject: [PATCH 1/1] Echo error response from RTD without formatting The rtd-trigger-build.sh starts a build at ReadTheDocs and parses the response, a small JSON like this: {"build_triggered":false,"project":"unicorn","versions":[]} This change drops the invocation of jq that attempts to pretty-print the JSON to the log when the build is not triggered, because that call was failing for inexplicable reasons. Change-Id: Ic4369b7e0b9172d4b4c9c3544224b6b5325813a5 Signed-off-by: Lott, Christopher (cl778h) --- .../notes/fix-rtd-trigger-build-34b35822e840dae7.yaml | 12 ++++++++++++ shell/rtd-trigger-build.sh | 9 +++++---- 2 files changed, 17 insertions(+), 4 deletions(-) create mode 100644 releasenotes/notes/fix-rtd-trigger-build-34b35822e840dae7.yaml diff --git a/releasenotes/notes/fix-rtd-trigger-build-34b35822e840dae7.yaml b/releasenotes/notes/fix-rtd-trigger-build-34b35822e840dae7.yaml new file mode 100644 index 00000000..c9071d4e --- /dev/null +++ b/releasenotes/notes/fix-rtd-trigger-build-34b35822e840dae7.yaml @@ -0,0 +1,12 @@ +--- +fixes: + - | + Echo error response from RTD without formatting. The script + rtd-trigger-build.sh starts a build at ReadTheDocs and parses + the response, a small JSON like this: + + {"build_triggered":false,"project":"unicorn","versions":[]} + + This change drops the invocation of jq that attempts to pretty-print + the JSON to the log when the build is not triggered, because that + call was failing for inexplicable reasons. diff --git a/shell/rtd-trigger-build.sh b/shell/rtd-trigger-build.sh index d272c2d7..e0a6f002 100644 --- a/shell/rtd-trigger-build.sh +++ b/shell/rtd-trigger-build.sh @@ -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. # @@ -35,9 +35,10 @@ json=$(curl -X POST -d "branches=${GERRIT_BRANCH}" -d "token=$RTD_TOKEN" "$RTD_B 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" -- 2.16.6