-
Notifications
You must be signed in to change notification settings - Fork 408
/
.travis-setup.sh
executable file
·105 lines (87 loc) · 3.27 KB
/
.travis-setup.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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
# Copyright 2014 Google Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#! /bin/bash
set -x
set -e
# Make sure /dev/shm has correct permissions.
ls -l /dev/shm
sudo chmod 1777 /dev/shm
ls -l /dev/shm
uname -a
cat /etc/lsb-release
npm install
# npm may update the package-lock.json. Revert this to avoid failing grunt-checkrepo.
git checkout HEAD package-lock.json
npm install -g grunt-cli
sudo apt-get update --fix-missing
# Install python-imaging from the environment rather then build it.
# If the below fails, pip will build it via the requirements.txt
# sudo apt-get install python-imaging
# VIRTUAL_ENV_site_packages=$(echo $VIRTUAL_ENV/lib/*/site-packages)
# VIRTUAL_ENV_python_version=$(echo $VIRTUAL_ENV_site_packages | sed -e's@.*/\(.*\)/site-packages@\1@')
# ln -s /usr/lib/$VIRTUAL_ENV_python_version/dist-packages/PIL.pth $VIRTUAL_ENV_site_packages/PIL.pth
# ln -s /usr/lib/$VIRTUAL_ENV_python_version/dist-packages/PIL $VIRTUAL_ENV_site_packages/PIL
export VERSION=$(echo $BROWSER | sed -e's/[^-]*-//')
export BROWSER=$(echo $BROWSER | sed -e's/-.*//')
echo BROWSER=$BROWSER
echo VERSION=$VERSION
sudo ln -sf $(which true) $(which xdg-desktop-menu)
case $BROWSER in
Android)
sudo apt-get install -qq --force-yes \
libc6:i386 libgcc1:i386 gcc-4.6-base:i386 libstdc++5:i386 \
libstdc++6:i386 lib32z1 libreadline6-dev:i386 \
libncurses5-dev:i386
bash tools/android/setup.sh
;;
Chrome)
echo "Getting $VERSION of $BROWSER"
export CHROME=google-chrome-${VERSION}_current_amd64.deb
wget https://dl.google.com/linux/direct/$CHROME
sudo dpkg --install $CHROME || sudo apt-get -f install
which google-chrome
ls -l `which google-chrome`
if [ -f /opt/google/chrome/chrome-sandbox ]; then
export CHROME_SANDBOX=/opt/google/chrome/chrome-sandbox
else
export CHROME_SANDBOX=$(ls /opt/google/chrome*/chrome-sandbox)
fi
# Download a custom chrome-sandbox which works inside OpenVC containers (used on travis).
sudo rm -f $CHROME_SANDBOX
sudo wget https://googledrive.com/host/0B5VlNZ_Rvdw6NTJoZDBSVy1ZdkE -O $CHROME_SANDBOX
sudo chown root:root $CHROME_SANDBOX; sudo chmod 4755 $CHROME_SANDBOX
sudo md5sum $CHROME_SANDBOX
google-chrome --version
;;
Firefox)
sudo rm -f /usr/local/bin/firefox
case $VERSION in
stable)
;;
beta)
yes "\n" | sudo add-apt-repository -y ppa:mozillateam/firefox-next
;;
# TODO(alancutter): Add support for firefox-aurora.
# This will need to download the binary manually as the ubuntu-mozilla-daily
# ppa doesn't support the version of linux that Travis uses.
esac
sudo apt-get update --fix-missing
sudo apt-get install firefox
which firefox
ls -l `which firefox`
firefox --version
;;
esac
# R=tools/python/requirements.txt
# pip install -r $R --use-mirrors || pip install -r $R