Skip to content

Instantly share code, notes, and snippets.

@cirpo
Forked from mjumbewu/browserstack_tunnel_setup.sh
Last active August 29, 2015 14:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cirpo/a0e665c6df4e78e60300 to your computer and use it in GitHub Desktop.
Save cirpo/a0e665c6df4e78e60300 to your computer and use it in GitHub Desktop.
#!/bin/bash
# Setup and start BrowserStack Tunnel for your TravisCI build
#
# This script was adopted from Santiago Suarez Ordoñez's Sauce Connect
# setup script: https://gist.github.com/santiycr/5139565/
#
# This script requires your .travis.yml to include the following private
# env variable:
#
# * BROWSERSTACK_ACCESS_KEY
#
# You can find the access key for your account at
# http://www.browserstack.com/local-testing
#
# Curl and run this script as part of your .travis.yml before_script section:
#
# before_script:
# - curl https://gist.github.com/mjumbewu/6040423/raw/browserstack_tunnel_setup.sh | bash
BROWSERSTACK_TUNNEL_URL="http://www.browserstack.com/BrowserStackTunnel.jar"
BROWSERSTACK_TUNNEL_DIR="/tmp/browserstack-$RANDOM"
# Download and extract the program
mkdir -p $BROWSERSTACK_TUNNEL_DIR
cd $BROWSERSTACK_TUNNEL_DIR
curl $BROWSERSTACK_TUNNEL_URL > BrowserStackTunnel.jar
# Start it
java -jar BrowserStackTunnel.jar \
$BROWSERSTACK_ACCESS_KEY \
localhost,8000,0 &
# Wait a few seconds for it to be ready
sleep 5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment