forked from edgewall/trac
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
180 lines (180 loc) · 5.62 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
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
version: ~> 1.0
language: python
python: 2.7
addons:
apt:
packages:
- python-subversion
cache:
directories:
- "$HOME/.cache/pip"
- "$HOME/.pyenv"
- "$HOME/venv-lib"
before_install:
- test -n "$pyver" || pyver="$(python -c "$print_version")"
- 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:
- |
requires='Jinja2 lxml twill==0.9.1'
if [ "$build" != minimum ]; then requires="$requires Babel Pygments docutils textile pytz"; fi
if [ "$tracdb" = postgresql ]; 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
before_script:
- | # Link Subversion bindings to the virtualenv.
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
- |
case "$tracdb" in
postgresql)
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;"
tracdb_uri='postgres://tracuser:password@localhost/trac?schema=tractest'
;;
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_uri='mysql://tracuser:password@localhost/trac?charset=utf8mb4'
;;
sqlite)
tracdb_version=
tracdb_uri='sqlite:test.db'
;;
*)
tracdb_version=
tracdb_uri=
;;
esac
echo ".uri = $tracdb_uri" >Makefile.cfg
- echo "$tracdb_version"
script:
- if [ "$build" != minimum ]; then make compile; fi
- make Trac.egg-info unit-test functional-test;
before_deploy:
- cat contrib/travis/edgewall_host_key >> $HOME/.ssh/known_hosts
- keyfile=/tmp/id_rsa
- openssl aes-256-cbc -K $encrypted_c097e63a4ddf_key -iv $encrypted_c097e63a4ddf_iv
-in contrib/travis/id_rsa.enc -out "$keyfile".base64 -d
- cat "$keyfile".base64 | base64 --decode >"$keyfile"
- chmod 0600 "$keyfile"
- pip install setuptools-git
- make compile release
notifications:
email:
recipients:
secure: lIn4a3G6ww61t3o12DS4aWwEwD6Hl2kxcsZgkxvhU2MgzviJ5j3EBV5F/BlbQmR1BqM51qgDOXoQTO+y9cvzAYBkIy/gfLqZjAl0hfZep6iGZgl1cnUW4c5i9+wkF8PzTaQm+q9gwlIQ7JVedWw9jzHBIn80tCgTcavahAzyelk=
jobs:
include:
- name: Linux | Python 2.7 | SQLite (in-mem) | Minimal
os: linux
python: 2.7
virtualenv:
system_site_packages: true
env: tracdb= build=minimum
- name: Linux | Python 2.7 | SQLite (in-mem)
os: linux
python: 2.7
virtualenv:
system_site_packages: true
env: tracdb=
- name: Linux | Python 2.7 | SQLite
os: linux
python: 2.7
virtualenv:
system_site_packages: true
env: tracdb=sqlite
- name: Linux | Python 2.7 | PostgreSQL
os: linux
python: 2.7
virtualenv:
system_site_packages: true
services: postgresql
env: tracdb=postgresql
- name: Linux | Python 2.7 | MySQL
os: linux
python: 2.7
virtualenv:
system_site_packages: true
services: mysql
env: tracdb=mysql
- name: Linux | Python 2.7 | SQLite (in-mem) | Minimal
os: osx
language: generic
env: pyver=2.7 tracdb= build=minimum
- name: Linux | Python 2.7 | SQLite (in-mem)
os: osx
language: generic
env: pyver=2.7 tracdb=
- name: OSX | Python 2.7 | SQLite
os: osx
language: generic
env: pyver=2.7 tracdb=sqlite
- name: OSX | Python 2.7 | PostgreSQL
os: osx
language: generic
env: pyver=2.7 tracdb=postgresql
- stage: deploy
before_script: skip
script: skip
deploy:
provider: script
skip_cleanup: true
script: scp -i "$keyfile" dist/Trac-* [email protected]:/var/ftp/pub/trac/incoming
on:
repo: edgewall/trac
all_branches: true