-
Notifications
You must be signed in to change notification settings - Fork 0
/
selenium-run.sh
33 lines (27 loc) · 917 Bytes
/
selenium-run.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
#!/bin/bash
# Stop the existing the zalenium docker container if its runnning
sudo docker stop zalenium
# Start the zalenium docker container in 8082 port
sudo /usr/bin/docker run -d --rm -i --name zalenium -p 8082:4444 \
-v /var/run/docker.sock:/var/run/docker.sock \
-v /tmp/videos:/home/seluser/videos \
--privileged dosel/zalenium start --videoRecordingEnabled false --desiredContainers 1
ip="$(curl -s http://checkip.amazonaws.com/)"
url="http://$ip:8082/vnc/host/172.17.0.3/port/50000/?nginx=&path=proxy/172.17.0.3:50000/websockify&view_only=false"
for i in {0..31}
do
count=$(sudo docker ps | grep zalenium_ | wc -l)
if [[ "$count" = "1" ]]; then
break
fi
if [[ "$i" = "30" ]]; then
echo "$(tput setaf 1) Error starting zalenium container. Please contact Crio Support"
exit 1
fi
sleep 1
done
sleep 4
echo ""
echo ""
echo $url
exit 0