-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
120 lines (120 loc) · 3.68 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
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
120
language: python
sudo: false
addons:
apt:
packages:
- python-subversion
cache:
directories:
- "$HOME/.cache/pip"
- "$HOME/venv-lib"
matrix:
include:
- os: linux
python: "2.6"
env: tracdb=
- os: linux
python: "2.6"
env: tracdb=sqlite
- os: linux
python: "2.6"
env: tracdb=postgres
- os: linux
python: "2.6"
env: tracdb=mysql
- os: linux
python: "2.7_with_system_site_packages"
env: tracdb=
- os: linux
python: "2.7_with_system_site_packages"
env: tracdb=sqlite
- os: linux
python: "2.7_with_system_site_packages"
env: tracdb=postgres
- os: linux
python: "2.7_with_system_site_packages"
env: tracdb=mysql
- os: osx
language: generic
env: pyver=2.6 tracdb=
- os: osx
language: generic
env: pyver=2.6 tracdb=sqlite
- os: osx
language: generic
env: pyver=2.6 tracdb=postgres
- os: osx
language: generic
env: pyver=2.7 tracdb=
- os: osx
language: generic
env: pyver=2.7 tracdb=sqlite
- os: osx
language: generic
env: pyver=2.7 tracdb=postgres
before_install:
- rvm get head
- |
set -e
case "$tracdb" in
postgres)
if [ "$TRAVIS_OS_NAME" = osx ]; then
rm -rf /usr/local/var/postgres
pg_ctl initdb --pgdata /usr/local/var/postgres
pg_ctl -w start --pgdata /usr/local/var/postgres --log /usr/local/var/postgres/postgresql.log || {
rc=$?
cat /usr/local/var/postgres/postgresql.log
exit $rc
}
createuser -s postgres
fi
tracdb_version="PostgreSQL: $(psql -U postgres -t -c 'SELECT version()')"
echo "$tracdb_version"
psql -U postgres -e -c "CREATE USER tracuser NOSUPERUSER NOCREATEDB CREATEROLE PASSWORD 'password';"
psql -U postgres -e -c "CREATE DATABASE trac OWNER tracuser;"
;;
mysql)
tracdb_version="MySQL: $(mysql -u root -sN -e 'SELECT version()')"
echo "$tracdb_version"
mysql -u root -v -e "CREATE DATABASE trac DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_bin;"
mysql -u root -v -e "CREATE USER tracuser@localhost IDENTIFIED BY 'password';"
mysql -u root -v -e "GRANT ALL ON trac.* TO tracuser@localhost; FLUSH PRIVILEGES;"
;;
*)
tracdb_version=
;;
esac
- |
set -e
if [ "$TRAVIS_OS_NAME" = osx ]; then
test -d $HOME/venv-lib || mkdir $HOME/venv-lib
PYTHONPATH=$HOME/venv-lib /usr/bin/easy_install-$pyver -ZU -d $HOME/venv-lib virtualenv
PYTHONPATH=$HOME/venv-lib /usr/bin/python$pyver -m virtualenv $HOME/venv-$pyver
source $HOME/venv-$pyver/bin/activate
python --version
pip --version
fi
install:
- test -d "$HOME/.pip" || mkdir "$HOME/.pip"
- ( echo "[global]"; echo "cache-dir = $HOME/.cache/pip" ) >"$HOME/.pip/pip.conf"
- pip install --upgrade pip
- pip install Genshi==0.7 'Babel!=2.3.0,!=2.3.1' Pygments docutils lxml pytz twill==0.9.1
- if [ "$tracdb" = postgres ]; then pip install psycopg2; fi
- if [ "$tracdb" = mysql ]; then pip install MySQL-python; fi
- pip freeze
- |
set -e
case "$tracdb" in
sqlite) tracdb_uri='sqlite:test.db' ;;
postgres) tracdb_uri='postgres://tracuser:password@localhost/trac?schema=tractest' ;;
mysql) tracdb_uri='mysql://tracuser:password@localhost/trac' ;;
*) tracdb_uri= ;;
esac
echo ".uri = $tracdb_uri" >Makefile.cfg
script:
- if [ -n "$tracdb_version" ]; then echo "$tracdb_version"; fi
- make Trac.egg-info compile unit-test functional-test
notifications:
email:
recipients: