Merge pull request #3162 from ether/fix_connection_to_sauce_labs

Fix connection to sauce labs
fix/adjust_loading_animation
Luiza Pagliari 2017-04-06 03:20:15 -03:00 committed by GitHub
commit 9bea5a64b8
1 changed files with 6 additions and 8 deletions

View File

@ -1,16 +1,14 @@
#!/bin/bash
# download and unzip the sauce connector
curl http://saucelabs.com/downloads/Sauce-Connect-latest.zip > /tmp/sauce.zip
unzip /tmp/sauce.zip -d /tmp
curl https://saucelabs.com/downloads/sc-latest-linux.tar.gz > /tmp/sauce.tar.gz
tar zxf /tmp/sauce.tar.gz --directory /tmp
mv /tmp/sc-*-linux /tmp/sauce_connect
# start the sauce connector in background and make sure it doesn't output the secret key
(java -jar /tmp/Sauce-Connect.jar $SAUCE_USERNAME $SAUCE_ACCESS_KEY -f /tmp/tunnel > /dev/null )&
# save the sauce pid in a file
echo $! > /tmp/sauce.pid
(/tmp/sauce_connect/bin/sc --user $SAUCE_USERNAME --key $SAUCE_ACCESS_KEY --pidfile /tmp/sauce.pid --readyfile /tmp/tunnel > /dev/null )&
# wait for the tunnel to build up
while [ ! -e "/tmp/tunnel" ]
do
sleep 1
done
sleep 1
done