File tree Expand file tree Collapse file tree 2 files changed +61
-0
lines changed Expand file tree Collapse file tree 2 files changed +61
-0
lines changed Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ source /opt/bin/functions.sh
4
+ /opt/bin/generate_config > /home/seluser/selenium/config.json
5
+
6
+ export GEOMETRY=" $SCREEN_WIDTH " " x" " $SCREEN_HEIGHT " " x" " $SCREEN_DEPTH "
7
+
8
+ if [ ! -e /home/seluser/selenium/config.json ]; then
9
+ echo No Selenium Node configuration file, the node-base image is not intended to be run directly. 1>&2
10
+ exit 1
11
+ fi
12
+
13
+ if [ -z " $HUB_PORT_4444_TCP_ADDR " ]; then
14
+ echo Not linked with a running Hub container 1>&2
15
+ exit 1
16
+ fi
17
+
18
+ function shutdown {
19
+ kill -s SIGTERM $NODE_PID
20
+ wait $NODE_PID
21
+ }
22
+
23
+ if [ ! -z " $REMOTE_HOST " ]; then
24
+ >&2 echo " REMOTE_HOST variable is *DEPRECATED* in these docker containers. Please use SE_OPTS=\" -host <host> -port <port>\" instead!"
25
+ exit 1
26
+ fi
27
+
28
+ if [ ! -z " $SE_OPTS " ]; then
29
+ echo " appending selenium options: ${SE_OPTS} "
30
+ fi
31
+
32
+ SERVERNUM=$( get_server_num)
33
+
34
+ rm -f /tmp/.X* lock
35
+
36
+ DISPLAY=$DISPLAY \
37
+ xvfb-run -n $SERVERNUM --server-args=" -screen 0 $GEOMETRY -ac +extension RANDR" \
38
+ java ${JAVA_OPTS} -jar /home/seluser/selenium/selenium-server-standalone.jar \
39
+ -role node \
40
+ -hub http://$HUB_PORT_4444_TCP_ADDR :$HUB_PORT_4444_TCP_PORT /grid/register \
41
+ -nodeConfig /home/seluser/selenium/config.json \
42
+ ${SE_OPTS} &
43
+ NODE_PID=$!
44
+
45
+ trap shutdown SIGTERM SIGINT
46
+ for i in $( seq 1 10)
47
+ do
48
+ xdpyinfo -display $DISPLAY > /dev/null 2>&1
49
+ if [ $? -eq 0 ]; then
50
+ break
51
+ fi
52
+ echo Waiting xvfb...
53
+ sleep 0.5
54
+ done
55
+
56
+ fluxbox -display $DISPLAY &
57
+
58
+ x11vnc -forever -usepw -shared -rfbport 5900 -display $DISPLAY &
59
+
60
+ wait $NODE_PID
Original file line number Diff line number Diff line change @@ -21,3 +21,4 @@ cat ./README.template.md \
21
21
| sed " s/##FOLDER##/$1 /" > $FOLDER /README.md
22
22
23
23
cp ./README-short.txt $FOLDER /README-short.txt
24
+ cp ./entry_point.sh $FOLDER /entry_point.sh
You can’t perform that action at this time.
0 commit comments