-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathentry_point.sh
More file actions
executable file
·48 lines (36 loc) · 1.22 KB
/
entry_point.sh
File metadata and controls
executable file
·48 lines (36 loc) · 1.22 KB
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
#!/bin/bash
source /opt/bin/functions.sh
/opt/bin/generate_config > /opt/selenium/config.json
export GEOMETRY="$SCREEN_WIDTH""x""$SCREEN_HEIGHT""x""$SCREEN_DEPTH"
if [ ! -e /opt/selenium/config.json ]; then
echo No Selenium Node configuration file, the node-base image is not intended to be run directly. 1>&2
exit 1
fi
if [ -z "$HUB_PORT_4444_TCP_ADDR" ]; then
echo Not linked with a running Hub container 1>&2
exit 1
fi
function shutdown {
kill -s SIGTERM $NODE_PID
wait $NODE_PID
}
if [ ! -z "$REMOTE_HOST" ]; then
>&2 echo "REMOTE_HOST variable is *DEPRECATED* in these docker containers. Please use SE_OPTS=\"-host <host> -port <port>\" instead!"
exit 1
fi
NODE_HOSTNAME=`hostname`
SE_OPTS="-host $NODE_HOSTNAME $SE_OPTS"
if [ ! -z "$SE_OPTS" ]; then
echo "appending selenium options: ${SE_OPTS}"
fi
SERVERNUM=$(get_server_num)
rm -f /tmp/.X*lock
xvfb-run -n $SERVERNUM --server-args="-screen 0 $GEOMETRY -ac +extension RANDR" \
java ${JAVA_OPTS} -jar /opt/selenium/selenium-server-standalone.jar \
-role node \
-hub http://$HUB_PORT_4444_TCP_ADDR:$HUB_PORT_4444_TCP_PORT/grid/register \
-nodeConfig /opt/selenium/config.json \
${SE_OPTS} &
NODE_PID=$!
trap shutdown SIGTERM SIGINT
wait $NODE_PID