-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
/
start-selenium-grid-router.sh
executable file
·82 lines (67 loc) · 2.14 KB
/
start-selenium-grid-router.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
#!/usr/bin/env bash
# set -e: exit asap if a command exits with a non-zero status
set -e
echo "Starting Selenium Grid Router..."
if [[ -z "${SE_SESSIONS_MAP_HOST}" ]]; then
echo "SE_SESSIONS_MAP_HOST not set, exiting!" 1>&2
exit 1
fi
if [[ -z "${SE_SESSIONS_MAP_PORT}" ]]; then
echo "SE_SESSIONS_MAP_PORT not set, exiting!" 1>&2
exit 1
fi
if [[ -z "${SE_DISTRIBUTOR_HOST}" ]]; then
echo "DISTRIBUTOR_HOST not set, exiting!" 1>&2
exit 1
fi
if [[ -z "${SE_DISTRIBUTOR_PORT}" ]]; then
echo "DISTRIBUTOR_PORT not set, exiting!" 1>&2
exit 1
fi
if [[ -z "${SE_SESSION_QUEUE_HOST}" ]]; then
echo "SE_SESSION_QUEUE_HOST not set, exiting!" 1>&2
exit 1
fi
if [[ -z "${SE_SESSION_QUEUE_PORT}" ]]; then
echo "SE_SESSION_QUEUE_PORT not set, exiting!" 1>&2
exit 1
fi
if [ ! -z "$SE_SUB_PATH" ]; then
echo "Using SE_SUB_PATH: ${SE_SUB_PATH}"
SUB_PATH_CONFIG="--sub-path ${SE_SUB_PATH}"
fi
if [ ! -z "$SE_OPTS" ]; then
echo "Appending Selenium options: ${SE_OPTS}"
fi
if [ ! -z "$SE_ROUTER_HOST" ]; then
echo "Using SE_ROUTER_HOST: ${SE_ROUTER_HOST}"
HOST_CONFIG="--host ${SE_ROUTER_HOST}"
fi
if [ ! -z "$SE_ROUTER_PORT" ]; then
echo "Using SE_ROUTER_PORT: ${SE_ROUTER_PORT}"
PORT_CONFIG="--port ${SE_ROUTER_PORT}"
fi
EXTRA_LIBS=""
if [ ! -z "$SE_ENABLE_TRACING" ]; then
EXTERNAL_JARS=$(</external_jars/.classpath.txt)
EXTRA_LIBS="--ext "
EXTRA_LIBS=${EXTRA_LIBS}:${EXTERNAL_JARS}
echo "Tracing is enabled"
echo "Classpath will be enriched with these external jars : " ${EXTRA_LIBS}
else
echo "Tracing is disabled"
fi
java ${JAVA_OPTS:-$SE_JAVA_OPTS} \
-jar /opt/selenium/selenium-server.jar \
${EXTRA_LIBS} router \
--sessions-host "${SE_SESSIONS_MAP_HOST}" --sessions-port "${SE_SESSIONS_MAP_PORT}" \
--distributor-host "${SE_DISTRIBUTOR_HOST}" --distributor-port "${SE_DISTRIBUTOR_PORT}" \
--sessionqueue-host "${SE_SESSION_QUEUE_HOST}" --sessionqueue-port "${SE_SESSION_QUEUE_PORT}" \
--session-request-timeout ${SE_SESSION_REQUEST_TIMEOUT} \
--session-retry-interval ${SE_SESSION_RETRY_INTERVAL} \
--relax-checks true \
--bind-host ${SE_BIND_HOST} \
${HOST_CONFIG} \
${PORT_CONFIG} \
${SUB_PATH_CONFIG} \
${SE_OPTS}