forked from GeotrekCE/Geotrek-admin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
68 lines (61 loc) · 3.05 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
language: python
python:
- "2.7"
env:
- ACTION=test
- ACTION=deploy
- ACTION=integration
matrix:
allow_failures:
- python: 2.7
env: ACTION=integration
before_install:
# Download bundle of python eggs, and use it as download cache
- mkdir -p $HOME/.buildout/downloads
- echo -e "[buildout]\ndownload-cache=$HOME/.buildout/downloads" > $HOME/.buildout/default.cfg
- "wget http://depot.makina-corpus.org/public/geotrek/geotrek-bundle.tar.gz -O /tmp/geotrek-bundle.tar.gz || true"
- "tar -zxf /tmp/geotrek-bundle.tar.gz --directory=$HOME || true"
# Use lastest django-mapentity, useful when developing both
- make etc/settings.ini
- echo -e "[sources]\nmapentity = git https://github.com/makinacorpus/django-mapentity.git branch=develop" >> etc/settings.ini
# GDAL-fix -- packaging is miserable, no way to obtain libgdal-dev for libgdal1 when libgdal1h available
- sudo apt-get update -qq
- sudo apt-get download -y libgdal-dev
- sudo dpkg-deb -x libgdal-dev*.deb /
- sudo ln -sf /usr/lib/libgdal.so.1 /usr/lib/libgdal.so
- sudo ldconfig
# GDAL-fix -- Do not install GDAL from install script
- sed -i "s/gdal-bin//" install.sh
- sed -i "s/libgdal-dev//" install.sh
- sed -i "s/GDAL=.*/GDAL=1.9.0/" conf/buildout.cfg
# GDAL-fix -- Do not install postgis locally, trick test on host
- sed -i "s/localhost/127.0.0.1/" etc/settings.ini
# GDAL-fix -- Use Travis PostGIS, initialize DB
- sudo sed -i "s/^client_min_messages.*$/client_min_messages = log/" /etc/postgresql/*/main/postgresql.conf
- sudo /etc/init.d/postgresql restart
- psql -c "CREATE DATABASE geotrekdb ENCODING 'UTF8' TEMPLATE template0;" -U postgres
- psql -c 'CREATE EXTENSION postgis;' -U postgres -d geotrekdb
- psql -c "CREATE USER geotrek WITH PASSWORD 'geotrek' SUPERUSER;" -U postgres
- psql -c 'GRANT ALL PRIVILEGES ON DATABASE geotrekdb TO geotrek;' -U postgres
- psql -c 'GRANT ALL ON spatial_ref_sys,geometry_columns,raster_columns TO geotrek;' -U postgres -d geotrekdb
# GDAL-fix -- End (remove with Ubuntu 14.04)
install:
- deactivate
- if [[ $ACTION == test ]]; then ./install.sh --tests || cat ./install.log; fi
- if [[ $ACTION == deploy || $ACTION == integration ]]; then ./install.sh --noinput || cat ./install.log; fi
script:
- if [[ $ACTION == deploy || $ACTION == integration ]]; then make load_demo; fi
- if [[ $ACTION == deploy ]]; then make test_nav host=localhost port=80; fi
- if [[ $ACTION == integration ]]; then make test_export host=localhost port=80; fi
- if [[ $ACTION == test ]]; then make env_test test; fi
- if [[ $ACTION == test ]]; then make test_js; fi
# Re-run for coverage
- if [[ $ACTION == test ]]; then rm -rf ./var/cache/* ./var/media/maps/*; fi
- if [[ $ACTION == test ]]; then ./bin/coverage run ./bin/django test geotrek; fi
after_success:
# Report coverage results to coveralls.io
- if [[ $ACTION == test ]]; then ./bin/coverage report -m; fi
- if [[ $ACTION == test ]]; then sudo pip install coveralls; fi
- if [[ $ACTION == test ]]; then coveralls; fi
notifications:
irc: "irc.freenode.org#geotrek"