diff options
| author | Vojta Jina | 2013-08-12 21:29:20 -0700 |
|---|---|---|
| committer | Vojta Jina | 2013-08-13 23:02:21 -0700 |
| commit | c6ca827150fd98ffba3245e93f1245bdc07887b1 (patch) | |
| tree | 552c7d7bccdd6f4d332a99609135fb8e401d9ec9 | |
| parent | 79a88ecfa692a53ab2d109af537f0f675491902b (diff) | |
| download | angular.js-c6ca827150fd98ffba3245e93f1245bdc07887b1.tar.bz2 | |
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.
| -rwxr-xr-x | lib/sauce/sauce_connect_setup.sh | 15 |
1 files changed, 12 insertions, 3 deletions
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 & |
