forked from yukinying/chrome-headless-browser-docker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
28 lines (22 loc) · 1.1 KB
/
.travis.yml
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
sudo: required
group: edge
services:
- docker
language: bash
env:
- REPO=yukinying/chrome-headless-browser DIR=chrome
- REPO=yukinying/chrome-headless-browser-selenium DIR=chromedriver
before_install:
- export VERSION0=`docker run --name chrome --rm --entrypoint=/usr/bin/google-chrome-unstable $REPO --version | grep -Po '(?<=Google Chrome )[^ ]+'`
- wget https://dl.google.com/linux/direct/google-chrome-unstable_current_amd64.deb
- docker build -t $REPO $DIR
script:
- export VERSION1=`docker run --name chrome --rm --entrypoint=/usr/bin/google-chrome-unstable $REPO --version | grep -Po '(?<=Google Chrome )[^ ]+'`
- docker tag $REPO $REPO:latest
- docker tag $REPO $REPO:$VERSION1
- docker run --init -it --rm --name chrome --shm-size=1024m --cap-add=SYS_ADMIN --entrypoint=/usr/bin/google-chrome-unstable $REPO:latest --headless --disable-gpu --dump-dom http://info.cern.ch/hypertext/WWW/TheProject.html
after_success:
- if [ "$TRAVIS_BRANCH" == "master" ] && [ "$VERSION0" != "$VERSION1" ]; then
docker login -u="$DOCKER_USERNAME" -p="$DOCKER_PASSWORD";
docker push $REPO;
fi