From c6ca827150fd98ffba3245e93f1245bdc07887b1 Mon Sep 17 00:00:00 2001 From: Vojta Jina Date: Mon, 12 Aug 2013 21:29:20 -0700 Subject: chore(sauce): use tunnel-identifier and ready-file only on Travis When running locally, there's not TRAVIS_JOB_NUMBER env variable defined and it screws the Sauce Connect (it uses a tunnel with empty name), this makes it work locally without defining TRAVIS_JOB_NUMBER env variable. Also, if you run the sauce_connect_setup.sh locally, without having SAUCE_CONNECT_READY_FILE, it does not pass the `--ready-file` argument to avoid Sauce Connect blowing up. --- lib/sauce/sauce_connect_setup.sh | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'lib') diff --git a/lib/sauce/sauce_connect_setup.sh b/lib/sauce/sauce_connect_setup.sh index 7ca8917b..7dfb6ba5 100755 --- a/lib/sauce/sauce_connect_setup.sh +++ b/lib/sauce/sauce_connect_setup.sh @@ -25,8 +25,17 @@ unzip $CONNECT_DOWNLOAD rm $CONNECT_DOWNLOAD + +ARGS="" + +# Set tunnel-id only on Travis, to make local testing easier. +if [ ! -z "$TRAVIS_JOB_NUMBER" ]; then + ARGS="$ARGS --tunnel-identifier $TRAVIS_JOB_NUMBER" +fi +if [ ! -z "$SAUCE_CONNECT_READY_FILE" ]; then + ARGS="$ARGS --readyfile $SAUCE_CONNECT_READY_FILE" +fi + echo "Starting Sauce Connect in the background" echo "Logging into $CONNECT_LOG" -java -jar Sauce-Connect.jar --readyfile $SAUCE_CONNECT_READY_FILE \ - --tunnel-identifier $TRAVIS_JOB_NUMBER \ - $SAUCE_USERNAME $SAUCE_ACCESS_KEY > $CONNECT_LOG & +java -jar Sauce-Connect.jar $ARGS $SAUCE_USERNAME $SAUCE_ACCESS_KEY > $CONNECT_LOG & -- cgit v1.2.3