-
Notifications
You must be signed in to change notification settings - Fork 53
/
.travis.yml
64 lines (55 loc) · 2.43 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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
group: edge
dist: focal
virt: vm
os: linux
arch:
- amd64
services:
- docker
language: shell
addons:
apt:
update: true
sources:
- sourceline: 'deb https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable'
key_url: 'https://download.docker.com/linux/ubuntu/gpg'
packages:
- docker-ce
- docker-ce-cli
env:
- DIR=chrome-stable REPO=yukinying/chrome-headless-browser-stable TARGET=Chromium
- DIR=chrome REPO=yukinying/chrome-headless-browser TARGET=Chrome
- DIR=chrome-xl REPO=yukinying/chrome-headless-browser-xl TARGET=Chrome
- DIR=chromedriver REPO=yukinying/chrome-headless-browser-selenium TARGET=Chrome
jobs:
include:
- arch: arm64-graviton2
env: DIR=chrome-stable REPO=yukinying/chrome-headless-browser-stable TARGET=Chromium
before_install:
# update libseccomp
# - sudo apt-get update
# - sudo apt-get -y install libseccomp
# # install latest docker
# - curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
# - sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
# - sudo apt-get update
# - sudo apt-get -y -o Dpkg::Options::="--force-confnew" install docker-ce
# collect data from previous image
- export ARCH=${TRAVIS_CPU_ARCH/-graviton2/} # remove unnecessary architecture annotation.
- export VERSION0=`docker run --name chrome --rm --entrypoint=/usr/bin/google-chrome $REPO --version | grep -Po "(?<=$TARGET )[^ ]+"`
- export VERSION0=${VERSION0:-NONE}
# build
- wget https://dl.google.com/linux/direct/google-chrome-unstable_current_amd64.deb
- echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin
- docker build -t $REPO $DIR
script:
- export VERSION1=`docker run --name chrome --rm --entrypoint=/usr/bin/google-chrome $REPO --version | grep -Po "(?<=$TARGET )[^ ]+"`
- echo "Version before build = $VERSION0"
- echo "Version after build = $VERSION1"
- docker tag $REPO $REPO:latest
- docker tag $REPO $REPO:$VERSION1
- docker tag $REPO $REPO-$ARCH:latest
- docker tag $REPO $REPO-$ARCH:$VERSION1
- docker run --init -it --rm --name chrome --cap-add=SYS_ADMIN --entrypoint=/usr/bin/google-chrome $REPO:latest --headless --disable-dev-shm-usage --disable-gpu --dump-dom http://info.cern.ch/hypertext/WWW/TheProject.html | grep "The World Wide Web project"
- test -x $DIR/tests/test.sh && cd $DIR/tests && ./test.sh && cd ../..
- ./push.sh