forked from camptocamp/c2cgeoportal
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
110 lines (96 loc) · 5.52 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
language: python
python:
- 2.7
services:
- postgresql
env:
global:
- secure: "UxpVOfQ9oePIcgRqsFzuVvpcng/syX6snuqw01XjK/3dWwyjhehBL17Yfzsn8NAgsiEdJ7SiTOhb3cfiHNHNX0mzfojPtvcFcGDmHGfH5nIufsGubeck6CErKHFT0uAhJywfPSgi53n0RteiIJAKc0bzaYzoMRG7RUPsvk3HRnE="
before_install:
- cat /etc/apt/sources.list.d/*
- sudo apt-get remove -y --force-yes python-zope.interface
- sudo apt-get install -y --force-yes aptitude
- sudo add-apt-repository -y ppa:stephane-brunner/precise-gis
- sudo apt-get update
- sudo aptitude install -y apache2 facter libapache2-mod-wsgi libapache2-mod-fcgid tomcat7 deploy cgi-mapserver postgis=2.0.3-2~precise4 postgresql-9.1-postgis-2.0=2.0.3-2~precise4 postgresql-9.1-postgis-2.0-scripts=2.0.3-2~precise4
- sudo -u postgres createdb -E UTF8 -T template0 template_postgis
- psql -d template_postgis -U postgres -f /usr/share/postgresql/9.1/contrib/postgis-2.0/postgis.sql > /dev/null
- psql -d template_postgis -U postgres -f /usr/share/postgresql/9.1/contrib/postgis-2.0/spatial_ref_sys.sql > /dev/null
#- psql -d template_postgis -U postgres -c "CREATE EXTENSION postgis;"
- sudo -u postgres createdb -E UTF8 -T template_postgis c2cgeoportal_test
- sudo -u postgres createdb -E UTF8 -T template_postgis geomapfish
- sudo -u postgres createuser www-data --no-superuser --no-createdb --no-createrole
- sudo -u postgres psql -q -d c2cgeoportal_test -f travis/db.sql
install:
- make -f travis.mk c2c-egg
- travis/pip.sh install tilecloud_chain
- .build/venv/bin/pip freeze | grep -v '^-e' | grep -v '^#'
- diff -u c2cgeoportal/scaffolds/update/CONST_versions.txt <(.build/venv/bin/pip freeze | grep -v '^-e' | grep -v '^#') | grep '^[+-]'
- make -f travis.mk build
- .build/venv/bin/pcreate -s c2cgeoportal_create /tmp/testgeomapfish package=testgeomapfish srid=21781 mobile_application_title="Mobile App éàè"
- .build/venv/bin/pcreate -s c2cgeoportal_update /tmp/testgeomapfish package=testgeomapfish > /dev/null # on create
- cp /tmp/testgeomapfish/project.yaml.mako project.yaml
- .build/venv/bin/pcreate -s c2cgeoportal_update /tmp/testgeomapfish package=testgeomapfish > /dev/null # on upgrade
- rm project.yaml
- .build/venv/bin/alembic -c c2cgeoportal/tests/functional/alembic.ini heads
- .build/venv/bin/alembic -c c2cgeoportal/tests/functional/alembic_static.ini heads
- travis/build-new-project.sh
- sudo /usr/sbin/apache2ctl graceful
script:
- uname -a
- sudo -u postgres psql --version
- node -v
- npm -v
- .build/venv/bin/flake8 --version
- python setup.py --version
- if [ ${TRAVIS_PULL_REQUEST} != "false" ] ; then git fetch origin ${TRAVIS_BRANCH}:${TRAVIS_BRANCH}; fi
- if [ ${TRAVIS_PULL_REQUEST} != "false" ] ; then git diff --check ${TRAVIS_BRANCH} -- ; fi
- find /tmp/testgeomapfish/CONST_alembic -name \*.py | xargs .build/venv/bin/flake8 --copyright-check --copyright-min-file-size=1 --copyright-regexp="Copyright \(c\) [0-9\-]*$(shell date +%Y), Camptocamp SA" --max-line-length=100
- find /tmp/testgeomapfish/setup.py /tmp/testgeomapfish/test/*.py /tmp/testgeomapfish/test/views -name \*.py | xargs .build/venv/bin/flake8 --max-line-length=100
- find /tmp/testgeomapfish/setup.py /tmp/testgeomapfish/test/*.py /tmp/testgeomapfish/test/views -name \*.py | xargs travis/quote
- travis/test-new-project.sh wsgi/viewer.js
- travis/test-new-project.sh wsgi/check_collector
- travis/test-new-project.sh wsgi/check_collector?type=all
- travis/status.sh /tmp/testgeomapfish/
- travis/empty-make-new-project.sh
- travis/empty-make.sh -f travis.mk build
- make -f travis.mk doc
- make -f travis.mk checks
- make -f travis.mk c2cgeoportal/tests/functional/alembic.ini
- travis/quote `find c2cgeoportal/lib c2cgeoportal/scaffolds/create c2cgeoportal/templates c2cgeoportal/tests c2cgeoportal/views -name '*.py'` c2cgeoportal/*.py setup.py
- travis/squote `find c2cgeoportal/scaffolds/update/CONST_alembic -name '*.py'`
- .build/venv/bin/alembic -c c2cgeoportal/tests/functional/alembic.ini upgrade head
- .build/venv/bin/alembic -c c2cgeoportal/tests/functional/alembic_static.ini upgrade head
- .build/venv/bin/alembic -c c2cgeoportal/tests/functional/alembic_static.ini downgrade base
- .build/venv/bin/alembic -c c2cgeoportal/tests/functional/alembic.ini downgrade base
- .build/venv/bin/python setup.py nosetests --stop --nocapture --nologcapture
- git checkout c2cgeoportal/locale/*/LC_MESSAGES/c2cgeoportal.po
- travis/status.sh
# verify c2cgeoportal version
- if [[ ${TRAVIS_TAG} =~ ^[0-9]+.[0-9]+.[0-9]+(dev[0-9]+|rc[0-9]|\.[0-9]+)?$ ]] ; then test `grep "REQUIREMENTS ?= 'c2cgeoportal==" c2cgeoportal/scaffolds/update/CONST_Makefile|awk -F '==' '{{print $2}}'` = "${TRAVIS_TAG}'" ; fi
- if [[ ${TRAVIS_TAG} =~ ^[0-9]+.[0-9]+.[0-9]+(dev[0-9]+|rc[0-9]|\.[0-9]+)?$ ]] ; then test `python setup.py --version` = ${TRAVIS_TAG} ; fi
after_failure:
- .build/venv/bin/python setup.py nosetests
after_success:
- travis/pip.sh install coveralls
- .build/venv/bin/coveralls
- openssl aes-256-cbc -K $encrypted_ae821512cabf_key -iv $encrypted_ae821512cabf_iv -in deploy_key.enc -out ~/.ssh/id_rsa -d | true
- chmod 600 ~/.ssh/id_rsa
- git config --global user.email [email protected]
- git config --global user.name Travis
- git remote set-url origin [email protected]:camptocamp/c2cgeoportal.git
- travis/deploy.sh
deploy:
provider: releases
api_key:
secure: hfVa8R7sI/gCL/K5grGaaVuzpt42T09fXqr6Ff18jpubI1onl/jqCWhIP6tvMSiE/AJ9gEqswRzf7YtpyykZmixJuR3tIjZDRzcA/U+Qfr4l2sJipzvvPXbir+HfgWUUK2r97+oHVLTCc+emaXzlOwLv5BuC0xV6uztTD192U8w=
file: "`ls dist/*.whl`"
skip_cleanup: true
on:
tags: true
python: 2.7
after_deploy:
travis/after_deploy.sh
notifications:
email:
on_failure: change