Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Commit cb89e02

Browse files
committedAug 14, 2013
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.
1 parent ac69392 commit cb89e02

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed
 

‎lib/sauce/sauce_connect_setup.sh

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,17 @@ unzip $CONNECT_DOWNLOAD
2525
rm $CONNECT_DOWNLOAD
2626

2727

28+
29+
ARGS=""
30+
31+
# Set tunnel-id only on Travis, to make local testing easier.
32+
if [ ! -z "$TRAVIS_JOB_NUMBER" ]; then
33+
ARGS="$ARGS --tunnel-identifier $TRAVIS_JOB_NUMBER"
34+
fi
35+
if [ ! -z "$SAUCE_CONNECT_READY_FILE" ]; then
36+
ARGS="$ARGS --readyfile $SAUCE_CONNECT_READY_FILE"
37+
fi
38+
2839
echo "Starting Sauce Connect in the background"
2940
echo "Logging into $CONNECT_LOG"
30-
java -jar Sauce-Connect.jar --readyfile $SAUCE_CONNECT_READY_FILE \
31-
--tunnel-identifier $TRAVIS_JOB_NUMBER \
32-
$SAUCE_USERNAME $SAUCE_ACCESS_KEY > $CONNECT_LOG &
41+
java -jar Sauce-Connect.jar $ARGS $SAUCE_USERNAME $SAUCE_ACCESS_KEY > $CONNECT_LOG &

0 commit comments

Comments
 (0)
This repository has been archived.