forked from edgewall/trac
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
133 lines (133 loc) · 4.04 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
121
122
123
124
125
126
127
128
129
130
131
132
133
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= build=minimum
- 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= build=minimum
- 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
requires='Genshi==0.7 lxml twill==0.9.1'
if [ "$build" != minimum ]; then requires="$requires Babel!=2.3.0,!=2.3.1 Pygments docutils textile pytz"; fi
if [ "$tracdb" = postgres ]; then requires="$requires psycopg2"; fi
if [ "$tracdb" = mysql ]; then requires="$requires MySQL-python"; fi
pip install $requires
- 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:
- echo "$tracdb_version"
- |
targets=Trac.egg-info
if [ "$build" != minimum ]; then targets="$targets compile"; fi
targets="$targets unit-test functional-test"
make $targets
notifications:
email:
recipients:
- trac-builds@googlegroups.com