Merge pull request #744 from mathquill/ci.fix-sauce-outdated
On CI, cached Sauce Connect is outdated
diff --git a/circle.yml b/circle.yml
index 6bcd75a..7fd97e5 100644
--- a/circle.yml
+++ b/circle.yml
@@ -44,19 +44,27 @@
mkdir -p ~/sauce-connect
cd ~/sauce-connect
+
if [ -x sc-*-linux/bin/sc ]; then
echo Using cached sc-*-linux/bin/sc
else
time wget https://saucelabs.com/downloads/sc-latest-linux.tar.gz
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
test -e ~/sauce_was_ready && exit
+
+ echo 'Sauce Connect failed, try redownloading (https://git.io/vSxsJ)'
+ rm -rf *
+ time wget https://saucelabs.com/downloads/sc-latest-linux.tar.gz
+ time tar -xzf sc-latest-linux.tar.gz
+
time sc-*-linux/bin/sc --user $SAUCE_USERNAME --api-key $SAUCE_ACCESS_KEY \
--readyfile ~/sauce_is_ready
test -e ~/sauce_was_ready && exit
+
echo 'ERROR: Exited twice without creating readyfile' \
| tee /dev/stderr > ~/sauce_is_ready
exit 1