forked from EFForg/https-everywhere
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup_travis.sh
executable file
·73 lines (65 loc) · 1.78 KB
/
setup_travis.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
63
64
65
66
67
68
69
70
71
72
73
#!/bin/bash
set -x
toplevel=$(git rev-parse --show-toplevel)
function setup_chrome {
# Install the latest version of the chromedriver
version=$(wget https://chromedriver.storage.googleapis.com/LATEST_RELEASE -q -O -)
url="https://chromedriver.storage.googleapis.com/${version}/chromedriver_linux64.zip"
wget -O /tmp/chromedriver.zip ${url}
sudo unzip /tmp/chromedriver.zip chromedriver -d /usr/local/bin/
sudo chmod a+x /usr/local/bin/chromedriver
}
function setup_firefox {
#version=$(curl -s https://api.github.com/repos/mozilla/geckodriver/releases/latest | grep tag_name | cut -d '"' -f 4)
# versions >= 0.18.0 are broken for esr, versions <= 0.17.0 have driver.set_timeouts broken
version="v0.17.0"
url="https://github.com/mozilla/geckodriver/releases/download/${version}/geckodriver-${version}-linux64.tar.gz"
wget -O /tmp/geckodriver.tar.gz ${url}
sudo tar -xvf /tmp/geckodriver.tar.gz -C /usr/local/bin/
sudo chmod a+x /usr/local/bin/geckodriver
# ./makexpi.sh requires xmllint
sudo apt-get -qq update
sudo apt-get install -y libxml2-utils
}
function browser_setup {
# install python stuff
pip install -r ${toplevel}/test/selenium/requirements.txt
}
function setup_lint {
pushd ${toplevel}/utils/eslint
npm install
popd
}
function setup_unittests {
pushd ${toplevel}/chromium
npm install
popd
}
function setup_docker {
docker build -t httpse .
}
case $INFO in
*chrome*)
setup_chrome
browser_setup
;;
*firefox*) # Install the latest version of geckodriver
setup_firefox
browser_setup
;;
*lint*)
setup_lint
;;
*unittests*)
setup_unittests
;;
*rules*|*fetch*)
setup_docker
;;
*preloaded*)
;;
*)
echo "bad INFO variable, got $INFO"
exit 1
;;
esac