Skip to content

Instantly share code, notes, and snippets.

@madflow
Forked from santiycr/sauce_connect_setup.sh
Last active December 13, 2015 10:23
Show Gist options
  • Save madflow/8a8ea7168f22530b633d to your computer and use it in GitHub Desktop.
Save madflow/8a8ea7168f22530b633d to your computer and use it in GitHub Desktop.
A small bash script to download and start Sauce Connect as part of a Travis Build.
#!/bin/bash
# Setup and start Sauce Connect for your Codeship Build
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 $SAUCE_USERNAME $SAUCE_ACCESS_KEY --readyfile $READY_FILE --tunnel-identifier $CI_BUILD_NUMBER &
# 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