CI: Fix retrying Sauce Connect
The || to retry doesn't work, I'm seeing the error message but no
retrying:
https://265-598343-gh.circle-artifacts.com/0/tmp/circle-artifacts.maPmtm4/sauce-connect.log
Presumably this means that when it fails, it still exits with a
successful non-zero exit status. Instead, lets check for the readyfile.
diff --git a/circle.yml b/circle.yml
index 75229ab..c723c88 100644
--- a/circle.yml
+++ b/circle.yml
@@ -52,9 +52,11 @@
time tar -xzf sc-latest-linux.tar.gz
fi
# Sauce Connect randomly fails so try twice https://git.io/vPN8v
- time sc-*-linux/bin/sc --user $SAUCE_USERNAME --api-key $SAUCE_ACCESS_KEY --readyfile ~/sauce_is_ready \
- || time sc-*-linux/bin/sc --user $SAUCE_USERNAME --api-key $SAUCE_ACCESS_KEY --readyfile ~/sauce_is_ready \
- || echo EXIT STATUS $? | tee /dev/stderr > ~/sauce_is_ready
+ time sc-*-linux/bin/sc --user $SAUCE_USERNAME --api-key $SAUCE_ACCESS_KEY --readyfile ~/sauce_is_ready
+ test -e sauce_is_ready \
+ || time sc-*-linux/bin/sc --user $SAUCE_USERNAME --api-key $SAUCE_ACCESS_KEY --readyfile ~/sauce_is_ready
+ test -e sauce_is_ready \
+ || echo 'ERROR: Exited twice without creating readyfile' | tee /dev/stderr > ~/sauce_is_ready
} >$CIRCLE_ARTIFACTS/sauce-connect.log 2>&1
:
background: true