Skip to content

Instantly share code, notes, and snippets.

@mhodgson
Last active April 2, 2021 10:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save mhodgson/8321439 to your computer and use it in GitHub Desktop.
Save mhodgson/8321439 to your computer and use it in GitHub Desktop.
#!/bin/bash
# Setup and start TEstingBot for your TravisCI build
# This script requires your .travis.yml to include the following two private env variables:
# TESTINGBOT_KEY
# TESTINGBOT_SECRET
# Follow the steps at http://blog.testingbot.com/2012/12/31/travis-ci-selenium-testing-with-testingbot 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
TUNNEL_JAR_URL="http://testingbot.com/downloads/testingbot-tunnel.zip"
TUNNEL_DIR="/tmp/testingbot-tunnel-$RANDOM"
TUNNEL_JAR_DOWNLOAD="testingbot-tunnel.zip"
READY_FILE="testingbot-ready-$RANDOM"
TUNNEL_LOG_FILE="testingbot-log-$RANDOM.log"
# Get Tunnel and start it
mkdir -p $TUNNEL_DIR
cd $TUNNEL_DIR
curl $TUNNEL_JAR_URL > $TUNNEL_JAR_DOWNLOAD
unzip $TUNNEL_JAR_DOWNLOAD
rm $TUNNEL_JAR_DOWNLOAD
cd testingbot-tunnel
java -jar testingbot-tunnel.jar $TESTINGBOT_KEY $TESTINGBOT_SECRET \
--readyfile $READY_FILE \
--fast-fail-regexps $CONNECT_DIRECT_DOMAINS \
--logfile $TUNNEL_LOG_FILE &
# 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