Skip to content

Commit 108c6de

Browse files
author
Tobias Stöckler
committed
Remove entry_point.sh scripts from .gitignore for building on Docker cloud
1 parent 991afd7 commit 108c6de

File tree

7 files changed

+294
-5
lines changed

7 files changed

+294
-5
lines changed

.gitignore

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,6 @@ node_modules/
77
# Vim swap files.
88
*.swp
99

10-
# Ignoring the generated entry_point.sh files in different folders
11-
Node*Debug/entry_point.sh
12-
StandaloneC*/entry_point.sh
13-
StandaloneF*/entry_point.sh
14-
1510
# Created by https://www.gitignore.io/api/virtualenv
1611

1712
### VirtualEnv ###

NodeChromeDebug/entry_point.sh

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
#!/bin/bash
2+
#
3+
# IMPORTANT: Change this file only in directory NodeDebug!
4+
5+
source /opt/bin/functions.sh
6+
/opt/bin/generate_config > /opt/selenium/config.json
7+
8+
export GEOMETRY="$SCREEN_WIDTH""x""$SCREEN_HEIGHT""x""$SCREEN_DEPTH"
9+
10+
if [ ! -e /opt/selenium/config.json ]; then
11+
echo No Selenium Node configuration file, the node-base image is not intended to be run directly. 1>&2
12+
exit 1
13+
fi
14+
15+
# In the long term the idea is to remove $HUB_PORT_4444_TCP_ADDR and $HUB_PORT_4444_TCP_PORT and only work with
16+
# $HUB_HOST and $HUB_PORT
17+
if [ ! -z "$HUB_HOST" ]; then
18+
HUB_PORT_PARAM=4444
19+
if [ ! -z "$HUB_PORT" ]; then
20+
HUB_PORT_PARAM=${HUB_PORT}
21+
fi
22+
echo "Connecting to the Hub using the host ${HUB_HOST} and port ${HUB_PORT_PARAM}"
23+
HUB_PORT_4444_TCP_ADDR=${HUB_HOST}
24+
HUB_PORT_4444_TCP_PORT=${HUB_PORT_PARAM}
25+
fi
26+
27+
if [ -z "$HUB_PORT_4444_TCP_ADDR" ]; then
28+
echo "Not linked with a running Hub container" 1>&2
29+
exit 1
30+
fi
31+
32+
function shutdown {
33+
kill -s SIGTERM $NODE_PID
34+
wait $NODE_PID
35+
}
36+
37+
REMOTE_HOST_PARAM=""
38+
if [ ! -z "$REMOTE_HOST" ]; then
39+
echo "REMOTE_HOST variable is set, appending -remoteHost"
40+
REMOTE_HOST_PARAM="-remoteHost $REMOTE_HOST"
41+
fi
42+
43+
if [ ! -z "$SE_OPTS" ]; then
44+
echo "appending selenium options: ${SE_OPTS}"
45+
fi
46+
47+
SERVERNUM=$(get_server_num)
48+
49+
rm -f /tmp/.X*lock
50+
51+
DISPLAY=$DISPLAY \
52+
xvfb-run -n $SERVERNUM --server-args="-screen 0 $GEOMETRY -ac +extension RANDR" \
53+
java ${JAVA_OPTS} -jar /opt/selenium/selenium-server-standalone.jar \
54+
-role node \
55+
-hub http://$HUB_PORT_4444_TCP_ADDR:$HUB_PORT_4444_TCP_PORT/grid/register \
56+
${REMOTE_HOST_PARAM} \
57+
-nodeConfig /opt/selenium/config.json \
58+
${SE_OPTS} &
59+
NODE_PID=$!
60+
61+
trap shutdown SIGTERM SIGINT
62+
for i in $(seq 1 10)
63+
do
64+
xdpyinfo -display $DISPLAY >/dev/null 2>&1
65+
if [ $? -eq 0 ]; then
66+
break
67+
fi
68+
echo Waiting xvfb...
69+
sleep 0.5
70+
done
71+
72+
fluxbox -display $DISPLAY &
73+
74+
x11vnc -forever -usepw -shared -rfbport 5900 -display $DISPLAY &
75+
76+
wait $NODE_PID

NodeFirefoxDebug/entry_point.sh

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
#!/bin/bash
2+
#
3+
# IMPORTANT: Change this file only in directory NodeDebug!
4+
5+
source /opt/bin/functions.sh
6+
/opt/bin/generate_config > /opt/selenium/config.json
7+
8+
export GEOMETRY="$SCREEN_WIDTH""x""$SCREEN_HEIGHT""x""$SCREEN_DEPTH"
9+
10+
if [ ! -e /opt/selenium/config.json ]; then
11+
echo No Selenium Node configuration file, the node-base image is not intended to be run directly. 1>&2
12+
exit 1
13+
fi
14+
15+
# In the long term the idea is to remove $HUB_PORT_4444_TCP_ADDR and $HUB_PORT_4444_TCP_PORT and only work with
16+
# $HUB_HOST and $HUB_PORT
17+
if [ ! -z "$HUB_HOST" ]; then
18+
HUB_PORT_PARAM=4444
19+
if [ ! -z "$HUB_PORT" ]; then
20+
HUB_PORT_PARAM=${HUB_PORT}
21+
fi
22+
echo "Connecting to the Hub using the host ${HUB_HOST} and port ${HUB_PORT_PARAM}"
23+
HUB_PORT_4444_TCP_ADDR=${HUB_HOST}
24+
HUB_PORT_4444_TCP_PORT=${HUB_PORT_PARAM}
25+
fi
26+
27+
if [ -z "$HUB_PORT_4444_TCP_ADDR" ]; then
28+
echo "Not linked with a running Hub container" 1>&2
29+
exit 1
30+
fi
31+
32+
function shutdown {
33+
kill -s SIGTERM $NODE_PID
34+
wait $NODE_PID
35+
}
36+
37+
REMOTE_HOST_PARAM=""
38+
if [ ! -z "$REMOTE_HOST" ]; then
39+
echo "REMOTE_HOST variable is set, appending -remoteHost"
40+
REMOTE_HOST_PARAM="-remoteHost $REMOTE_HOST"
41+
fi
42+
43+
if [ ! -z "$SE_OPTS" ]; then
44+
echo "appending selenium options: ${SE_OPTS}"
45+
fi
46+
47+
SERVERNUM=$(get_server_num)
48+
49+
rm -f /tmp/.X*lock
50+
51+
DISPLAY=$DISPLAY \
52+
xvfb-run -n $SERVERNUM --server-args="-screen 0 $GEOMETRY -ac +extension RANDR" \
53+
java ${JAVA_OPTS} -jar /opt/selenium/selenium-server-standalone.jar \
54+
-role node \
55+
-hub http://$HUB_PORT_4444_TCP_ADDR:$HUB_PORT_4444_TCP_PORT/grid/register \
56+
${REMOTE_HOST_PARAM} \
57+
-nodeConfig /opt/selenium/config.json \
58+
${SE_OPTS} &
59+
NODE_PID=$!
60+
61+
trap shutdown SIGTERM SIGINT
62+
for i in $(seq 1 10)
63+
do
64+
xdpyinfo -display $DISPLAY >/dev/null 2>&1
65+
if [ $? -eq 0 ]; then
66+
break
67+
fi
68+
echo Waiting xvfb...
69+
sleep 0.5
70+
done
71+
72+
fluxbox -display $DISPLAY &
73+
74+
x11vnc -forever -usepw -shared -rfbport 5900 -display $DISPLAY &
75+
76+
wait $NODE_PID

StandaloneChrome/entry_point.sh

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#!/bin/bash
2+
#
3+
# IMPORTANT: Change this file only in directory Standalone!
4+
5+
source /opt/bin/functions.sh
6+
7+
export GEOMETRY="$SCREEN_WIDTH""x""$SCREEN_HEIGHT""x""$SCREEN_DEPTH"
8+
9+
function shutdown {
10+
kill -s SIGTERM $NODE_PID
11+
wait $NODE_PID
12+
}
13+
14+
if [ ! -z "$SE_OPTS" ]; then
15+
echo "appending selenium options: ${SE_OPTS}"
16+
fi
17+
18+
SERVERNUM=$(get_server_num)
19+
20+
rm -f /tmp/.X*lock
21+
22+
xvfb-run -n $SERVERNUM --server-args="-screen 0 $GEOMETRY -ac +extension RANDR" \
23+
java ${JAVA_OPTS} -jar /opt/selenium/selenium-server-standalone.jar \
24+
${SE_OPTS} &
25+
NODE_PID=$!
26+
27+
trap shutdown SIGTERM SIGINT
28+
wait $NODE_PID

StandaloneChromeDebug/entry_point.sh

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
#!/bin/bash
2+
#
3+
# IMPORTANT: Change this file only in directory StandaloneDebug!
4+
5+
source /opt/bin/functions.sh
6+
7+
export GEOMETRY="$SCREEN_WIDTH""x""$SCREEN_HEIGHT""x""$SCREEN_DEPTH"
8+
9+
function shutdown {
10+
kill -s SIGTERM $NODE_PID
11+
wait $NODE_PID
12+
}
13+
14+
if [ ! -z "$SE_OPTS" ]; then
15+
echo "appending selenium options: ${SE_OPTS}"
16+
fi
17+
18+
rm -f /tmp/.X*lock
19+
20+
SERVERNUM=$(get_server_num)
21+
22+
DISPLAY=$DISPLAY \
23+
xvfb-run -n $SERVERNUM --server-args="-screen 0 $GEOMETRY -ac +extension RANDR" \
24+
java ${JAVA_OPTS} -jar /opt/selenium/selenium-server-standalone.jar \
25+
${SE_OPTS} &
26+
NODE_PID=$!
27+
28+
trap shutdown SIGTERM SIGINT
29+
for i in $(seq 1 10)
30+
do
31+
xdpyinfo -display $DISPLAY >/dev/null 2>&1
32+
if [ $? -eq 0 ]; then
33+
break
34+
fi
35+
echo Waiting xvfb...
36+
sleep 0.5
37+
done
38+
39+
fluxbox -display $DISPLAY &
40+
41+
x11vnc -forever -usepw -shared -rfbport 5900 -display $DISPLAY &
42+
43+
wait $NODE_PID

StandaloneFirefox/entry_point.sh

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#!/bin/bash
2+
#
3+
# IMPORTANT: Change this file only in directory Standalone!
4+
5+
source /opt/bin/functions.sh
6+
7+
export GEOMETRY="$SCREEN_WIDTH""x""$SCREEN_HEIGHT""x""$SCREEN_DEPTH"
8+
9+
function shutdown {
10+
kill -s SIGTERM $NODE_PID
11+
wait $NODE_PID
12+
}
13+
14+
if [ ! -z "$SE_OPTS" ]; then
15+
echo "appending selenium options: ${SE_OPTS}"
16+
fi
17+
18+
SERVERNUM=$(get_server_num)
19+
20+
rm -f /tmp/.X*lock
21+
22+
xvfb-run -n $SERVERNUM --server-args="-screen 0 $GEOMETRY -ac +extension RANDR" \
23+
java ${JAVA_OPTS} -jar /opt/selenium/selenium-server-standalone.jar \
24+
${SE_OPTS} &
25+
NODE_PID=$!
26+
27+
trap shutdown SIGTERM SIGINT
28+
wait $NODE_PID

StandaloneFirefoxDebug/entry_point.sh

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
#!/bin/bash
2+
#
3+
# IMPORTANT: Change this file only in directory StandaloneDebug!
4+
5+
source /opt/bin/functions.sh
6+
7+
export GEOMETRY="$SCREEN_WIDTH""x""$SCREEN_HEIGHT""x""$SCREEN_DEPTH"
8+
9+
function shutdown {
10+
kill -s SIGTERM $NODE_PID
11+
wait $NODE_PID
12+
}
13+
14+
if [ ! -z "$SE_OPTS" ]; then
15+
echo "appending selenium options: ${SE_OPTS}"
16+
fi
17+
18+
rm -f /tmp/.X*lock
19+
20+
SERVERNUM=$(get_server_num)
21+
22+
DISPLAY=$DISPLAY \
23+
xvfb-run -n $SERVERNUM --server-args="-screen 0 $GEOMETRY -ac +extension RANDR" \
24+
java ${JAVA_OPTS} -jar /opt/selenium/selenium-server-standalone.jar \
25+
${SE_OPTS} &
26+
NODE_PID=$!
27+
28+
trap shutdown SIGTERM SIGINT
29+
for i in $(seq 1 10)
30+
do
31+
xdpyinfo -display $DISPLAY >/dev/null 2>&1
32+
if [ $? -eq 0 ]; then
33+
break
34+
fi
35+
echo Waiting xvfb...
36+
sleep 0.5
37+
done
38+
39+
fluxbox -display $DISPLAY &
40+
41+
x11vnc -forever -usepw -shared -rfbport 5900 -display $DISPLAY &
42+
43+
wait $NODE_PID

0 commit comments

Comments
 (0)