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

Commit 8ac9fa3

Browse files
committed
Only docker login when needed in travis-ci
2 parents 07bd9e9 + 1d81cb9 commit 8ac9fa3

25 files changed

+397
-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 & 12 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,26 +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-
- ./host-scripts/gen-scm-source.sh
16-
- docker build -t selenium .
21+
- ./test/before_install_setup
22+
- travis_retry ./test/before_install_build
1723

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

2527
# Note: If we try to use `--net` Travis fails with System error: permission denied
2628
# Note: If we try to use `--link` Selenium fails with ConnectionRefusedError after
2729
# connect to selenium at http://172.17.0.4:24444/wd/hub
2830
# Unless, we use `--privileged` trick by Hiro Asari from Travis Corp.
2931
script:
30-
- docker exec -ti grid test
31-
- 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
3236

3337
# cleanup though doesn't seem to be necessary in Travis infra
3438
after_script:
35-
- docker exec grid stop || true
36-
- docker stop grid || true
37-
- 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-08
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...: 3.19.0-30-generic x86_64
31+
+ Built with: Docker version 1.10.3, build 20f81dd
32+
+ Image size: 2.822 GB
33+
+ Digest: sha256:27d9fdf65ce887392e275b9077e0c88a60f2f91e3d6e29a7d26f43218f9fa4be
34+
+ Image ID: sha256:3274cc68bc6800b6e507fc329dc2021a6bda8463fbbc91794750534501d84be9
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: 4 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
@@ -1084,8 +1083,9 @@ ADD utils/bin/selenium-grep.sh /usr/bin/errors
10841083
ADD xterm/bin/timeout-wait-xterm.sh /usr/bin/wait_all_done
10851084
ADD host-scripts/* /host-scripts/
10861085
ADD test/* /test/
1087-
ADD test/hola.py /usr/bin/hola
1088-
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
10891089

10901090
#==================
10911091
# Fix dirs (again)

README.md

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
![docker-selenium-grid](./images/grid_console.png)
1616

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

2020
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.
@@ -23,10 +23,10 @@ Note SeleniumHQ/docker-selenium project is more useful for building selenium gri
2323

2424
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.
2525

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

2828
docker run --rm -ti --name=grid -p 4444:24444 -p 5920:25900 \
29-
-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
3030

3131
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:
3232

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

6161
Then
6262

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

7272
Then
7373

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

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

9090
docker run -d --name=grid -p 4444:24444 -p 5920:25900 \
9191
-v /dev/shm:/dev/shm -e VNC_PASSWORD=hola \
9292
-e SCREEN_WIDTH=1920 -e SCREEN_HEIGHT=1480 \
93-
elgalu/selenium:2.53.0e
93+
elgalu/selenium:2.53.0f
9494

9595
docker exec grid wait_all_done 10s
9696

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

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

148148
If the VNC password was randomly generated find out with
149149

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

213213
You can simply verify that image id is indeed the correct one.
214214

215-
# e.g. full image id for tag 2.53.0e
215+
# e.g. full image id for tag 2.53.0f
216216
export IMGID="<<Please see CHANGELOG.md>>"
217-
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
218218
echo "Image ID tested ok"
219219
else
220220
echo "Image ID doesn't match"
@@ -224,7 +224,7 @@ You can simply verify that image id is indeed the correct one.
224224

225225
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:
226226

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

@@ -251,7 +251,7 @@ Host machine, terminal 2:
251251
-v /dev/shm:/dev/shm \
252252
-e SCREEN_WIDTH -e SCREEN_HEIGHT -e XE_DISP_NUM \
253253
-v /tmp/.X11-unix/X${XE_DISP_NUM}:/tmp/.X11-unix/X${XE_DISP_NUM} \
254-
elgalu/selenium:2.53.0e
254+
elgalu/selenium:2.53.0f
255255

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

@@ -273,7 +273,7 @@ ANYPORT=0
273273
REMOTE_DOCKER_SRV=localhost
274274
CONTAINER=$(docker run -d -p=0.0.0.0:${ANYPORT}:22222 -p=0.0.0.0:${ANYPORT}:24444 \
275275
-p=0.0.0.0:${ANYPORT}:25900 -e SCREEN_HEIGHT=1110 -e VNC_PASSWORD=hola \
276-
-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
277277
278278
# -- Option 2.docker run- Running docker on remote docker server like in the cloud
279279
# Useful if the docker server is running in the cloud. Establish free local ports
@@ -283,7 +283,7 @@ ssh ${REMOTE_DOCKER_SRV} #get into the remote docker provider somehow
283283
# it acts as a jump host so my public key is already on that server
284284
CONTAINER=$(docker run -d -p=0.0.0.0:${ANYPORT}:22222 -e SCREEN_HEIGHT=1110 \
285285
-e VNC_PASSWORD=hola -e SSH_AUTH_KEYS="$(cat ~/.ssh/authorized_keys)" \
286-
elgalu/selenium:2.53.0e
286+
elgalu/selenium:2.53.0f
287287
288288
# -- Common: Wait for the container to start
289289
./host-scripts/wait-docker-selenium.sh grid 7s
@@ -354,7 +354,7 @@ If you git clone this repo locally, i.e. cd into where the Dockerfile is, you ca
354354
355355
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:
356356
357-
docker pull elgalu/selenium:2.53.0e
357+
docker pull elgalu/selenium:2.53.0f
358358
359359
#### 2. Use this image
360360

0 commit comments

Comments
 (0)