-
Notifications
You must be signed in to change notification settings - Fork 12
/
before_install.sh
119 lines (108 loc) · 3.69 KB
/
before_install.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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
#!/bin/sh
travis_retry() {
local result=0
local count=1
while [ $count -le 3 ]; do
[ $result -ne 0 ] && {
echo -e "\n$The command \"$@\" failed *******************. Retrying, $count of 3.\n" >&2
}
"$@"
result=$?
[ $result -eq 0 ] && break
count=$(($count + 1))
sleep 1
done
[ $count -gt 3 ] && {
echo -e "\n$The command \"$@\" failed 3 times *******************.\n" >&2
}
return $result
}
#start the monitor
$TRAVIS_BUILD_DIR/ci/monitor.sh &
if [ "$TRAVIS_OS_NAME" = "linux" ]
then
if [ "$TRAVIS_EVENT_TYPE" = "cron" ] || [ "$TRAVIS_EVENT_TYPE" = "api" ]
then
echo "Ignoring before install stage for $TRAVIS_EVENT_TYPE event";
exit 0;
fi
fi
#install necessary basic packages for linux and mac
if [ "$TRAVIS_OS_NAME" = "linux" ] ;
then
travis_retry sudo apt-get update
travis_retry sudo apt-get install git libglew-dev freeglut3 freeglut3-dev libgcrypt11-dev zlib1g-dev g++ libssl-dev nasm autoconf valgrind libyaml-dev lcov cmake gdb quilt
fi
if [ "$TRAVIS_OS_NAME" = "osx" ] ;
then
brew update;
brew upgrade cmake;
brew install quilt
sudo /usr/sbin/DevToolsSecurity --enable
lldb --version
lldb --help
man lldb
fi
#install lighttpd, code coverage binaries for mac
if [ "$TRAVIS_OS_NAME" = "osx" ] ;
then
if [ "$TRAVIS_EVENT_TYPE" = "push" ] || [ "$TRAVIS_EVENT_TYPE" = "pull_request" ]
then
# brew install lighttpd
brew install gcovr
brew install lcov
brew install ccache
ls -al $HOME/.ccache
fi
fi
#setup lighttpd server
#if [ "$TRAVIS_EVENT_TYPE" = "push" ] || [ "$TRAVIS_EVENT_TYPE" = "pull_request" ]
#then
# if [ "$TRAVIS_OS_NAME" = "linux" ] ;
# then
# sudo cp $TRAVIS_BUILD_DIR/tests/pxScene2d/supportfiles/* /var/www/.
# sudo chmod -R 777 $TRAVIS_BUILD_DIR/tests/pxScene2d/supportfiles/
# sudo chmod -R 777 /var/www
# ls -lrt /etc/lighttpd/lighttpd.conf
# sudo /etc/init.d/lighttpd stop
# sudo sed -i "s/server.modules = (/server.modules = (\n\t\"mod_setenv\"\,/g" /etc/lighttpd/lighttpd.conf
# echo "setenv.add-response-header += (\"Cache-Control\" => \"public, max-age=1000\")"|sudo tee -a /etc/lighttpd/lighttpd.conf
# cat /etc/lighttpd/lighttpd.conf
# sudo /etc/init.d/lighttpd start
# elif [ "$TRAVIS_OS_NAME" = "osx" ] ;
# then
# brew services stop lighttpd
# sudo mkdir -p /usr/local/var/www
# sudo mkdir -p /var
# sudo ln -s /usr/local/var/www /var/www
# sudo cp $TRAVIS_BUILD_DIR/tests/pxScene2d/supportfiles/* /var/www/.
# sudo chmod -R 777 $TRAVIS_BUILD_DIR/tests/pxScene2d/supportfiles/
# sudo chmod -R 777 /var/www
# sudo sed -i -n "s/server.port = 8080/server.port = 80/g" /usr/local/etc/lighttpd/lighttpd.conf
# sudo sed -i -n "s/# \"mod_setenv\"/ \"mod_setenv\"/g" /usr/local/etc/lighttpd/modules.conf
# echo "setenv.add-response-header += (\"Cache-Control\" => \"public, max-age=1000\")"|sudo tee -a /usr/local/etc/lighttpd/modules.conf
# echo "Displaying lighttpd file ***************************"
# cat /usr/local/etc/lighttpd/lighttpd.conf
# echo "Displaying modules.conf file ***************************"
# cat /usr/local/etc/lighttpd/modules.conf
# echo "Displaying modules.conf file completed ***************************"
# sudo chmod -R 777 /usr/local
# ls -lrt /usr/local/var/
# sudo lighttpd -f /usr/local/etc/lighttpd/lighttpd.conf &
# ps -aef|grep lighttpd
# sudo netstat -a
# fi
#fi
#install codecov
if [ "$TRAVIS_EVENT_TYPE" = "push" ] || [ "$TRAVIS_EVENT_TYPE" = "pull_request" ]
then
if [ "$TRAVIS_OS_NAME" = "osx" ] ;
then
git clone https://github.com/pypa/pip
sudo easy_install pip
elif [ "$TRAVIS_OS_NAME" = "linux" ] ;
then
sudo apt-get install python-pip
fi
sudo pip install codecov
fi