-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
/
start-selenium-grid-hub.sh
executable file
·53 lines (44 loc) · 1.43 KB
/
start-selenium-grid-hub.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
#!/usr/bin/env bash
# set -e: exit asap if a command exits with a non-zero status
set -e
if [ ! -z "$SE_OPTS" ]; then
echo "Appending Selenium options: ${SE_OPTS}"
fi
if [ ! -z "$SE_HUB_HOST" ]; then
echo "Using SE_HUB_HOST: ${SE_HUB_HOST}"
HOST_CONFIG="--host ${SE_HUB_HOST}"
fi
if [ ! -z "$SE_HUB_PORT" ]; then
echo "Using SE_HUB_PORT: ${SE_HUB_PORT}"
PORT_CONFIG="--port ${SE_HUB_PORT}"
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_LOG_LEVEL" ]; then
echo "Appending Selenium options: --log-level ${SE_LOG_LEVEL}"
SE_OPTS="$SE_OPTS --log-level ${SE_LOG_LEVEL}"
fi
EXTRA_LIBS=""
if [ ! -z "$SE_ENABLE_TRACING" ]; then
EXTERNAL_JARS=$(</external_jars/.classpath.txt)
[ -n "$EXTRA_LIBS" ] && [ -n "${EXTERNAL_JARS}" ] && EXTRA_LIBS=${EXTRA_LIBS}:
EXTRA_LIBS="--ext "${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} hub \
--session-request-timeout ${SE_SESSION_REQUEST_TIMEOUT} \
--session-retry-interval ${SE_SESSION_RETRY_INTERVAL} \
--relax-checks ${SE_RELAX_CHECKS} \
--bind-host ${SE_BIND_HOST} \
--config /opt/selenium/config.toml \
${HOST_CONFIG} \
${PORT_CONFIG} \
${SUB_PATH_CONFIG} \
${SE_OPTS}