forked from jun66j5/trac
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
142 lines (142 loc) · 4.65 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
134
135
136
137
138
139
140
141
142
language: python
sudo: false
addons:
apt:
packages:
- python-subversion
cache:
directories:
- "$HOME/.cache/pip"
- "$HOME/.pyenv"
- "$HOME/venv-lib"
matrix:
include:
- os: linux
python: "2.7"
env: tracdb= build=minimum
- os: linux
python: "2.7"
env: tracdb=
- os: linux
python: "2.7"
env: tracdb=sqlite
- os: linux
python: "2.7"
env: tracdb=postgres
- os: linux
python: "2.7"
env: tracdb=mysql
- 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:
- print_version='import sys; print("%d.%d" % sys.version_info[:2])'
- test -n "$pyver" || pyver="$(python -c "$print_version")"
- |
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
- test -d "$HOME/.pip" || mkdir "$HOME/.pip"
- |
{
echo "[global]"
echo "cache-dir = $HOME/.cache/pip"
echo "[list]"
echo "format = columns"
} >"$HOME/.pip/pip.conf"
- |
if [ "$TRAVIS_OS_NAME" = osx ]; then
test -d $HOME/venv-lib || mkdir $HOME/venv-lib
eval "$(pyenv init -)"
pyver_latest="$(pyenv install -l | grep -E "^[ ]*${pyver/./\\.}\.[0-9]+$" | tail -1 | tr -d '[:blank:]')"
venv="$HOME/venv-$pyver_latest"
pyenv install --skip-existing $pyver_latest
pyenv shell $pyver_latest
pip install --upgrade virtualenv
python -m virtualenv $venv
source $venv/bin/activate
fi
- |
case "$pyver" in
2.7)
pip install --upgrade pip setuptools wheel
;;
esac
- pyenv --version
- pyenv versions
- python --version
- pip --version
- pip list
install:
- |
if [ "$TRAVIS_OS_NAME" = linux -a "$build" != minimum -a \
"$(/usr/bin/python -c "$print_version")" = "$(python -c "$print_version")" ]
then
print_sitelib='from distutils.sysconfig import get_python_lib; print(get_python_lib())'
sitelib_global="$(/usr/bin/python -c "$print_sitelib")"
sitelib_venv="$(python -c "$print_sitelib")"
ln -s "$sitelib_global/svn" "$sitelib_venv/svn"
ln -s "$sitelib_global/libsvn" "$sitelib_venv/libsvn"
python -c 'from svn import core'
fi
- |
requires='Jinja2 lxml twill==0.9.1'
if [ "$build" != minimum ]; then requires="$requires Genshi>=0.7 Babel Pygments docutils textile pytz"; fi
if [ "$tracdb" = postgres ]; then requires="$requires psycopg2"; fi
if [ "$tracdb" = mysql ]; then requires="$requires PyMySQL"; fi
pip install $requires
python -c 'import sys, pkg_resources as p; p.require(sys.argv[1:])' $requires
pip list
- |
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?charset=utf8mb4' ;;
*) 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:
secure: lIn4a3G6ww61t3o12DS4aWwEwD6Hl2kxcsZgkxvhU2MgzviJ5j3EBV5F/BlbQmR1BqM51qgDOXoQTO+y9cvzAYBkIy/gfLqZjAl0hfZep6iGZgl1cnUW4c5i9+wkF8PzTaQm+q9gwlIQ7JVedWw9jzHBIn80tCgTcavahAzyelk=