Skip to content
This repository was archived by the owner on Jun 30, 2021. It is now read-only.

Commit 1d81cb9

Browse files
committed
Fix travis-ci build and show Travis CI badges
Upgrade Ubuntu xenial-20160331.1 date + other fix Only docker login when needed + Upgrade Chrome
1 parent 537b150 commit 1d81cb9

25 files changed

+413
-117
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,4 @@ android/
99
binaries
1010
scm-source.json
1111
TODO.md
12+
docker_push.log

.travis.yml

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,12 @@ sudo: required
33
services:
44
- docker
55

6+
# Even though we run everything inside docker Travis require us to pick a
7+
# language else it will pick Ruby by default
8+
language: python
9+
python:
10+
- "2.7"
11+
612
env:
713
- TEST_SLEEPS="0.7"
814

@@ -12,25 +18,22 @@ env:
1218
# -p tcp -d 172.17.0.1 --dport 24444 -j ACCEPT:
1319
# iptables: No chain/target/match by that name. (exit status 1)
1420
before_install:
15-
- docker build -t selenium .
21+
- ./test/before_install_setup
22+
- travis_retry ./test/before_install_build
1623

1724
install:
18-
- docker run --name=grid -d -e VIDEO=true -v /dev/shm:/dev/shm selenium
19-
- docker exec -ti grid wait_all_done 40s
20-
- docker exec grid versions
21-
- docker exec grid errors || true
22-
- docker logs grid
25+
- ./test/install
2326

2427
# Note: If we try to use `--net` Travis fails with System error: permission denied
2528
# Note: If we try to use `--link` Selenium fails with ConnectionRefusedError after
2629
# connect to selenium at http://172.17.0.4:24444/wd/hub
2730
# Unless, we use `--privileged` trick by Hiro Asari from Travis Corp.
2831
script:
29-
- docker exec -ti grid test
30-
- docker cp grid:/test/console.png images/grid_console.png
32+
- ./test/script_scenario_1
33+
- ./test/script_scenario_2
34+
- ./test/script_archive
35+
- ./test/script_push
3136

3237
# cleanup though doesn't seem to be necessary in Travis infra
3338
after_script:
34-
- docker exec grid stop || true
35-
- docker stop grid || true
36-
- docker rm grid || true
39+
- ./test/after_script

CHANGELOG.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,32 @@ Note image ids also change after scm-source.json has being updated which trigger
77
###### To get container versions
88
docker exec grid versions
99

10+
## 2.53.0f
11+
+ Date: 2016-04-07
12+
+ Fix & chores to travis-ci build. Show Travis CI badges
13+
+ Fixing clear_x_locks.sh
14+
+ Upgrade Ubuntu xenial to 20160331.1
15+
+ Upgrade Java 9 build 9-ea+112 patch level
16+
+ Upgrade BrowserStack local to 5.2
17+
+ Upgrade Chrome patch to 49.0.2623.112
18+
+ Image tag details:
19+
+ Selenium: v2.53.0 (35ae25b)
20+
+ Chrome stable: 49.0.2623.112
21+
+ Firefox stable: 45.0.1
22+
+ Chromedriver: 2.21.371461 (633e689b520b25f3e264a2ede6b74ccc23cb636a)
23+
+ Java: Oracle Java 9 build 9-ea+112
24+
+ Timezone: Europe/Berlin
25+
+ FROM ubuntu:xenial-20160331.1
26+
+ Python: 2.7.11
27+
+ Sauce Connect 4.3.14, build 2010 d6099dc
28+
+ BrowserStack Local version 5.2
29+
+ Tested on kernel dev host..: 4.2.0-35-generic x86_64
30+
+ Tested on kernel CI host...: TBD_HOST_UNAME
31+
+ Built with: TBD_BUILT_WITH
32+
+ Image size: TBD_IMAGE_SIZE
33+
+ Digest: TBD_DIGEST
34+
+ Image ID: TBD_IMAGE_ID
35+
1036
## 2.53.0e
1137
+ Date: 2016-03-30
1238
+ Upgrade Chrome to 49.0.2623.110

CONTRIBUTING.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Contributing
2+
3+
## Local
4+
./test/before_install_build && ./test/install
5+
./test/script_scenario_1 && ./test/script_scenario_2
6+
./test/script_archive && ./test/script_push && ./test/after_script
7+
open ./videos/chrome/test.mkv
8+
travis lint
9+
git checkout -b tmp-2.53.0f
10+
git commit -m "Only docker login when needed in travis-ci"
11+
git tag 2.53.0f && git push origin tmp-2.53.0f && git push --tags
12+
#if Travis passes OK and changes got merged into master by elgalubot
13+
git push origin --delete tmp-2.53.0f
14+
15+
## Docker push from Travis CI
16+
Travis [steps](https://docs.travis-ci.com/user/docker/#Pushing-a-Docker-Image-to-a-Registry) involve `docker login` and docker credentials encryptions.
17+
18+
### Requirements
19+
20+
* Ruby
21+
* `gem install travis --no-rdoc --no-ri`
22+
* `travis login --user elgalu`
23+
* Encrypt environment variables with travis cli
24+
25+
### Encrypt
26+
travis env set DOCKER_EMAIL [email protected]
27+
travis env set DOCKER_USERNAME elgalubot
28+
travis env set DOCKER_PASSWORD secretsecret #1st space in purpose
29+
travis env set GH_TOKEN secretsecret

Dockerfile

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33
###################################################
44
#== Ubuntu xenial is 16.04, i.e. FROM ubuntu:16.04
55
# search for more at https://registry.hub.docker.com/_/ubuntu/tags/manage/
6-
# next: xenial-TBD
7-
FROM ubuntu:xenial-20160317
6+
FROM ubuntu:xenial-20160331.1
87
ENV UBUNTU_FLAVOR xenial
98

109
#== Ubuntu wily is 15.10, i.e. FROM ubuntu:15.10
@@ -602,6 +601,16 @@ RUN SHA="e4a37c6f8d1cb68f3813c7fdbcfee9a929788a75" \
602601
# && rm firefox-${FF_VER}.${FF_LANG}.linux64.tar.bz2 \
603602
# ;done
604603

604+
#-----------#
605+
# dumb-init #
606+
#-----------#
607+
# Use dumb-init to allow `docker stop` to end gracefully
608+
# result: it didn't help
609+
# RUN export DUMB_VERS="1.0.1" \
610+
# && wget -nv -O /tmp/dumb-init.deb \
611+
# "https://github.com/Yelp/dumb-init/releases/download/v${DUMB_VERS}/dumb-init_${DUMB_VERS}_amd64.deb" \
612+
# && dpkg -i /tmp/dumb-init.deb
613+
605614
# ------------------------#
606615
# Sauce Connect Tunneling #
607616
# ------------------------#
@@ -1074,8 +1083,9 @@ ADD utils/bin/selenium-grep.sh /usr/bin/errors
10741083
ADD xterm/bin/timeout-wait-xterm.sh /usr/bin/wait_all_done
10751084
ADD host-scripts/* /host-scripts/
10761085
ADD test/* /test/
1077-
ADD test/hola.py /usr/bin/hola
1078-
ADD test/test.sh /usr/bin/test
1086+
ADD test/run_test.sh /usr/bin/run_test
1087+
ADD test/selenium_test.sh /usr/bin/selenium_test
1088+
ADD test/python_test.py /usr/bin/python_test
10791089

10801090
#==================
10811091
# Fix dirs (again)

README.md

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
# Selenium in Docker with Chrome and Firefox
2+
[![Build Status](https://travis-ci.org/elgalu/docker-selenium.svg?branch=master)](https://travis-ci.org/elgalu/docker-selenium)
23
[![Gitter](https://badges.gitter.im/Join Chat.svg)](https://gitter.im/elgalu/docker-selenium?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
34

45
* selenium server grid with 2 nodes (chrome & firefox)
@@ -13,7 +14,7 @@
1314

1415
![docker-selenium-grid](./images/grid_console.png)
1516

16-
## Note this repo evolved into SeleniumHQ/docker-selenium
17+
## Notes on similar repo: SeleniumHQ/docker-selenium
1718
See: https://github.com/SeleniumHQ/docker-selenium
1819

1920
Note SeleniumHQ/docker-selenium project is more useful for building selenium grids while this one focuses on building disposable standalone seleniums with [video recording support](./docs/videos.md) and both browsers on the same container. It also adds some other features like [customizing the screen size](#screen-size) and [ssh access](#ssh) that can be particularly useful for tunneling support.
@@ -22,10 +23,10 @@ Note SeleniumHQ/docker-selenium project is more useful for building selenium gri
2223

2324
In general add `sudo` only if needed in your environment and `--privileged` or `-v /dev/shm:/dev/shm` if you really need it like when [Chrome crashes](https://github.com/elgalu/docker-selenium/issues/20) during your high gpu intensive tests.
2425

25-
docker pull elgalu/selenium:2.53.0e
26+
docker pull elgalu/selenium:2.53.0f
2627

2728
docker run --rm -ti --name=grid -p 4444:24444 -p 5920:25900 \
28-
-v /dev/shm:/dev/shm -e VNC_PASSWORD=hola elgalu/selenium:2.53.0e
29+
-v /dev/shm:/dev/shm -e VNC_PASSWORD=hola elgalu/selenium:2.53.0f
2930

3031
Make sure `docker run` finishes via active wait with below command. This is **mandatory** before start running your tests! Note `grid` is the name of the container:
3132

@@ -55,7 +56,7 @@ You can also ssh into the machine as long as `SSH_AUTH_KEYS="$(cat ~/.ssh/id_rsa
5556
docker run --rm -ti --name=grid -p=4444:24444 -p=5920:25900 -p=22222:22222 \
5657
-e SSHD=true \
5758
-e SSH_AUTH_KEYS="$(cat ~/.ssh/id_rsa.pub)" \
58-
-v /dev/shm:/dev/shm elgalu/selenium:2.53.0e
59+
-v /dev/shm:/dev/shm elgalu/selenium:2.53.0f
5960

6061
Then
6162

@@ -66,7 +67,7 @@ Include `-X` in ssh command if you want to redirect the started GUI programs to
6667
docker run --rm -ti --name=grid -p=4444:24444 -p=5920:25900 -p=22222:22222 \
6768
-e SSHD=true -e SSHD_X11FORWARDING=yes \
6869
-e SSH_AUTH_KEYS="$(cat ~/.ssh/id_rsa.pub)" \
69-
-v /dev/shm:/dev/shm elgalu/selenium:2.53.0e
70+
-v /dev/shm:/dev/shm elgalu/selenium:2.53.0f
7071

7172
Then
7273

@@ -84,12 +85,12 @@ Supervisor exposes an http server but is not enough to bind the ports via `docke
8485
### Screen size
8586
You can set a custom screen size at docker run time by providing `SCREEN_WIDTH` and `SCREEN_HEIGHT` environment variables:
8687

87-
docker pull elgalu/selenium:2.53.0e
88+
docker pull elgalu/selenium:2.53.0f
8889

8990
docker run -d --name=grid -p 4444:24444 -p 5920:25900 \
9091
-v /dev/shm:/dev/shm -e VNC_PASSWORD=hola \
9192
-e SCREEN_WIDTH=1920 -e SCREEN_HEIGHT=1480 \
92-
elgalu/selenium:2.53.0e
93+
elgalu/selenium:2.53.0f
9394

9495
docker exec grid wait_all_done 10s
9596

@@ -142,7 +143,7 @@ You need to pass the environment variable `-e NOVNC=true` in order to start the
142143

143144
docker run --rm -ti --name=grid -p 4444:24444 -p 5920:25900 \
144145
-v /dev/shm:/dev/shm -p 6080:26080 -e NOVNC=true \
145-
elgalu/selenium:2.53.0e
146+
elgalu/selenium:2.53.0f
146147

147148
If the VNC password was randomly generated find out with
148149

@@ -211,9 +212,9 @@ There are also additional steps you can take to ensure you're using the correct
211212

212213
You can simply verify that image id is indeed the correct one.
213214

214-
# e.g. full image id for tag 2.53.0e
215+
# e.g. full image id for tag 2.53.0f
215216
export IMGID="<<Please see CHANGELOG.md>>"
216-
if docker inspect -f='{{.Id}}' elgalu/selenium:2.53.0e |grep ${IMGID} &> /dev/null; then
217+
if docker inspect -f='{{.Id}}' elgalu/selenium:2.53.0f |grep ${IMGID} &> /dev/null; then
217218
echo "Image ID tested ok"
218219
else
219220
echo "Image ID doesn't match"
@@ -223,7 +224,7 @@ You can simply verify that image id is indeed the correct one.
223224

224225
Given docker.io currently allows to push the same tag image twice this represent a security concern but since docker >= 1.6.2 is possible to fetch the digest sha256 instead of the tag so you can be sure you're using the exact same docker image every time:
225226

226-
# e.g. sha256 for tag 2.53.0e
227+
# e.g. sha256 for tag 2.53.0f
227228
export SHA=<<Please see CHANGELOG.md>>
228229
docker pull elgalu/selenium@sha256:${SHA}
229230

@@ -250,7 +251,7 @@ Host machine, terminal 2:
250251
-v /dev/shm:/dev/shm \
251252
-e SCREEN_WIDTH -e SCREEN_HEIGHT -e XE_DISP_NUM \
252253
-v /tmp/.X11-unix/X${XE_DISP_NUM}:/tmp/.X11-unix/X${XE_DISP_NUM} \
253-
elgalu/selenium:2.53.0e
254+
elgalu/selenium:2.53.0f
254255

255256
Now when you run your tests instead of connecting. If docker run fails try `xhost +`
256257

@@ -272,7 +273,7 @@ ANYPORT=0
272273
REMOTE_DOCKER_SRV=localhost
273274
CONTAINER=$(docker run -d -p=0.0.0.0:${ANYPORT}:22222 -p=0.0.0.0:${ANYPORT}:24444 \
274275
-p=0.0.0.0:${ANYPORT}:25900 -e SCREEN_HEIGHT=1110 -e VNC_PASSWORD=hola \
275-
-e SSH_AUTH_KEYS="$(cat ~/.ssh/id_rsa.pub)" elgalu/selenium:2.53.0e
276+
-e SSH_AUTH_KEYS="$(cat ~/.ssh/id_rsa.pub)" elgalu/selenium:2.53.0f
276277
277278
# -- Option 2.docker run- Running docker on remote docker server like in the cloud
278279
# Useful if the docker server is running in the cloud. Establish free local ports
@@ -282,7 +283,7 @@ ssh ${REMOTE_DOCKER_SRV} #get into the remote docker provider somehow
282283
# it acts as a jump host so my public key is already on that server
283284
CONTAINER=$(docker run -d -p=0.0.0.0:${ANYPORT}:22222 -e SCREEN_HEIGHT=1110 \
284285
-e VNC_PASSWORD=hola -e SSH_AUTH_KEYS="$(cat ~/.ssh/authorized_keys)" \
285-
elgalu/selenium:2.53.0e
286+
elgalu/selenium:2.53.0f
286287
287288
# -- Common: Wait for the container to start
288289
./host-scripts/wait-docker-selenium.sh grid 7s
@@ -353,7 +354,7 @@ If you git clone this repo locally, i.e. cd into where the Dockerfile is, you ca
353354
354355
If you prefer to download the final built image from docker you can pull it, personally I always prefer to build them manually except for the base images like Ubuntu 14.04.2:
355356
356-
docker pull elgalu/selenium:2.53.0e
357+
docker pull elgalu/selenium:2.53.0f
357358
358359
#### 2. Use this image
359360

0 commit comments

Comments
 (0)