-
Notifications
You must be signed in to change notification settings - Fork 3.1k
/
start.sh
executable file
·62 lines (51 loc) · 1.78 KB
/
start.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
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
# This script is embedded in the docker image, and so the image must be updated when changes
# to the script are made. To do this, assuming you have docker installed:
# In tools/docker/ :
# docker build .
# docker ps # and look for the id of the image you just built
# docker tag <image> <tag>
# docker push <tag>
# Update the `image` specified in the project's .taskcluster.yml file
#!/bin/bash
set -ex
REMOTE=${1:-https://github.com/web-platform-tests/wpt}
REF=${2:-master}
REVISION=${3:-FETCH_HEAD}
BROWSER=${4:-all}
CHANNEL=${5:-nightly}
cd ~
mkdir web-platform-tests
cd web-platform-tests
git init
git remote add origin ${REMOTE}
# Initially we just fetch 50 commits in order to save several minutes of fetching
git fetch --quiet --depth=50 origin ${REF}
if [[ ! `git rev-parse --verify -q ${REVISION}` ]];
then
# But if for some reason the commit under test isn't in that range, we give in and
# fetch everything
git fetch -q --unshallow ${REMOTE}
git rev-parse --verify ${REVISION}
fi
git checkout -b build ${REVISION}
sudo sh -c './wpt make-hosts-file >> /etc/hosts'
if [[ $BROWSER == "chrome" ]] || [[ "$BROWSER" == all ]]
then
# Install Chrome dev
if [[ "$CHANNEL" == "dev" ]] || [[ "$CHANNEL" == "nightly" ]]
then
deb_archive=google-chrome-unstable_current_amd64.deb
elif [[ "$CHANNEL" == "beta" ]]
then
deb_archive=google-chrome-beta_current_amd64.deb
elif [[ "$CHANNEL" == "stable" ]]
then
deb_archive=google-chrome-stable_current_amd64.deb
else
echo Unrecognized release channel: $CHANNEL >&2
exit 1
fi
wget https://dl.google.com/linux/direct/$deb_archive
sudo apt-get -qqy update && sudo gdebi -n $deb_archive
fi
sudo Xvfb $DISPLAY -screen 0 ${SCREEN_WIDTH}x${SCREEN_HEIGHT}x${SCREEN_DEPTH} &