Use double bracket conditional compound command 92/64492/3
authorAric Gardner <agardner@linuxfoundation.org>
Thu, 9 Jul 2020 20:09:36 +0000 (16:09 -0400)
committerAric Gardner <agardner@linuxfoundation.org>
Mon, 13 Jul 2020 21:47:09 +0000 (17:47 -0400)
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 <stdin>:1): Cannot index string with string "success"
./script: line 11: [: ==: unary operator expected

Signed-off-by: Aric Gardner <agardner@linuxfoundation.org>
Change-Id: Ic7554ddfa384b817ad3aac311972e6cfc52e0b49

releasenotes/notes/lf-rtdv3-jobs-809e51d2bf6794d8.yaml [new file with mode: 0644]
shell/rtdv3.sh

diff --git a/releasenotes/notes/lf-rtdv3-jobs-809e51d2bf6794d8.yaml b/releasenotes/notes/lf-rtdv3-jobs-809e51d2bf6794d8.yaml
new file mode 100644 (file)
index 0000000..3c887b5
--- /dev/null
@@ -0,0 +1,4 @@
+---
+fixes:
+  - |
+    Fix quoting bug in rtdv3.sh script that caused failures to exit improperly.
index 23d373d..08f98a2 100644 (file)
@@ -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"