forked from cyrille-leclerc/java-build-tools-dockerfile
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathentry_point.sh
More file actions
30 lines (20 loc) · 697 Bytes
/
entry_point.sh
File metadata and controls
30 lines (20 loc) · 697 Bytes
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
#!/bin/bash
# source: https://github.com/SeleniumHQ/docker-selenium/blob/3.0.1-erbium/Standalone/entry_point.sh
source /opt/bin/functions.sh
export GEOMETRY="$SCREEN_WIDTH""x""$SCREEN_HEIGHT""x""$SCREEN_DEPTH"
function shutdown {
kill -s SIGTERM $NODE_PID
wait $NODE_PID
}
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 \
${SE_OPTS} &
NODE_PID=$!
trap shutdown SIGTERM SIGINT
# cloudbees specific: use 'exec "$@"' and not 'wait $NODE_PID'
exec "$@"