2012-10-28 16:48:51 +00:00
|
|
|
#!/bin/bash
|
2012-10-30 21:49:04 +00:00
|
|
|
# download and unzip the sauce connector
|
2019-12-21 08:04:39 +00:00
|
|
|
#
|
|
|
|
# ACHTUNG: as of 2019-12-21, downloading sc-latest-linux.tar.gz does not work.
|
|
|
|
# It is necessary to explicitly download a specific version, for
|
|
|
|
# example https://saucelabs.com/downloads/sc-4.5.4-linux.tar.gz
|
|
|
|
# Supported versions are currently listed at:
|
|
|
|
# https://wiki.saucelabs.com/display/DOCS/Downloading+Sauce+Connect+Proxy
|
2020-04-03 01:27:05 +00:00
|
|
|
if [ -z "${SAUCE_USERNAME}" ]; then echo "SAUCE_USERNAME is unset - exiting"; exit 1; fi
|
|
|
|
if [ -z "${SAUCE_ACCESS_KEY}" ]; then echo "SAUCE_ACCESS_KEY is unset - exiting"; exit 1; fi
|
|
|
|
|
2020-07-13 14:12:39 +00:00
|
|
|
curl https://saucelabs.com/downloads/sc-4.6.2-linux.tar.gz > /tmp/sauce.tar.gz
|
2017-04-06 06:04:17 +00:00
|
|
|
tar zxf /tmp/sauce.tar.gz --directory /tmp
|
2017-04-06 06:12:45 +00:00
|
|
|
mv /tmp/sc-*-linux /tmp/sauce_connect
|
2012-10-30 21:49:04 +00:00
|
|
|
|
|
|
|
# start the sauce connector in background and make sure it doesn't output the secret key
|
2020-07-13 14:12:39 +00:00
|
|
|
(/tmp/sauce_connect/bin/sc --user "${SAUCE_USERNAME}" --key "${SAUCE_ACCESS_KEY}" -i "${TRAVIS_JOB_NUMBER}" --pidfile /tmp/sauce.pid --readyfile /tmp/tunnel > /dev/null )&
|
2012-10-30 21:49:04 +00:00
|
|
|
|
|
|
|
# wait for the tunnel to build up
|
|
|
|
while [ ! -e "/tmp/tunnel" ]
|
|
|
|
do
|
2017-04-06 06:04:17 +00:00
|
|
|
sleep 1
|
|
|
|
done
|