Last active
June 1, 2016 04:24
-
-
Save nicholasserra/7f4927a8309e49d01e484eb0678f5d93 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Setup and start Sauce Connect for your TravisCI build | |
# This script requires your .travis.yml to include the following two private env variables: | |
# SAUCE_USERNAME | |
# SAUCE_ACCESS_KEY | |
# Follow the steps at https://saucelabs.com/opensource/travis to set that up. | |
# | |
# Curl and run this script as part of your .travis.yml before_script section: | |
# before_script: | |
# - curl https://gist.github.com/santiycr/5139565/raw/sauce_connect_setup.sh | bash | |
CONNECT_URL="http://saucelabs.com/downloads/Sauce-Connect-latest.zip" | |
CONNECT_DIR="/tmp/sauce-connect-$RANDOM" | |
CONNECT_DOWNLOAD="Sauce_Connect.zip" | |
READY_FILE="connect-ready-$RANDOM" | |
# Get Connect and start it | |
mkdir -p $CONNECT_DIR | |
cd $CONNECT_DIR | |
curl $CONNECT_URL > $CONNECT_DOWNLOAD | |
unzip $CONNECT_DOWNLOAD | |
rm $CONNECT_DOWNLOAD | |
java -jar Sauce-Connect.jar --readyfile $READY_FILE \ | |
--tunnel-identifier $CIRCLE_BUILD_NUM \ | |
$SAUCE_USERNAME $SAUCE_ACCESS_KEY & | |
# Wait for Connect to be ready before exiting | |
while [ ! -f $READY_FILE ]; do | |
sleep .5 | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment