From b6e270851b4e1eca28b2fbef85598f40d1bed90e Mon Sep 17 00:00:00 2001 From: Aric Gardner Date: Thu, 9 Jul 2020 16:09:36 -0400 Subject: [PATCH] Use double bracket conditional compound command Odd failures in the read the docs jobs casued by not quoting "$result" Im going to quote it and switch to double bracket. Fixed the issue in my testing. Errors seen were: jq: error (at :1): Cannot index string with string "success" ./script: line 11: [: ==: unary operator expected Signed-off-by: Aric Gardner Change-Id: Ic7554ddfa384b817ad3aac311972e6cfc52e0b49 --- releasenotes/notes/lf-rtdv3-jobs-809e51d2bf6794d8.yaml | 4 ++++ shell/rtdv3.sh | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 releasenotes/notes/lf-rtdv3-jobs-809e51d2bf6794d8.yaml diff --git a/releasenotes/notes/lf-rtdv3-jobs-809e51d2bf6794d8.yaml b/releasenotes/notes/lf-rtdv3-jobs-809e51d2bf6794d8.yaml new file mode 100644 index 00000000..3c887b55 --- /dev/null +++ b/releasenotes/notes/lf-rtdv3-jobs-809e51d2bf6794d8.yaml @@ -0,0 +1,4 @@ +--- +fixes: + - | + Fix quoting bug in rtdv3.sh script that caused failures to exit improperly. diff --git a/shell/rtdv3.sh b/shell/rtdv3.sh index 23d373d1..08f98a29 100644 --- a/shell/rtdv3.sh +++ b/shell/rtdv3.sh @@ -18,7 +18,7 @@ watchbuild(){ buildid=$(lftools rtd project-build-trigger "$rtdproject" "$1" | jq '.build.id') result=null - while [ $result == null ]; do + while [[ "$result" == null ]]; do sleep 10 result=$(lftools rtd project-build-details "$rtdproject" "$buildid" | jq '.success') echo "INFO Current result of running build $result" -- 2.16.6