set -e
export
+TOKEN=$(pwgen)
TEST_LANGUAGE=$(echo $JOB_NAME | cut -d "-" -f2)
TEST_BROWSER=$(echo $JOB_NAME | cut -d "-" -f3)
figlet $TEST_LANGUAGE
figlet $TEST_BROWSER
-TOKEN=$(pwgen)
+if [ "$TEST_BROWSER" = "firefox" ] ; then
+ TEST_PORT=4444
+elif [ "$TEST_BROWSER" = "chrome" ] ; then
+ TEST_PORT=4445
+else
+ figlet "unknown browser"
+ exit 1
+fi
-ssh -i ~jenkins/.ssh/id_selenium -t selenium@seoul ./runit.sh $TOKEN $TEST_LANGUAGE $TEST_BROWSER
+ssh -i ~jenkins/.ssh/id_selenium -t selenium@seoul ./runit.sh $TOKEN $TEST_LANGUAGE $TEST_BROWSER $TEST_PORT
scp -r -i ~jenkins/.ssh/id_selenium selenium@seoul:$TOKEN/* .
ssh -i ~jenkins/.ssh/id_selenium selenium@seoul rm ./$TOKEN -Rf