forked from camptocamp/c2cgeoportal
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
153 lines (136 loc) · 6.37 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
language: python
python:
- 2.7
services:
- postgresql
env:
global:
secure: aZWcHZWV8lN2SNU2fcUsG8+fVQLOxwDUFYDvuftZALebRG2AHINTkbS31sKbeSwS19ZYpjcuVOKC9HxNAlnMxsdO1NvvFEbSJJD/yqq0V4EfTRqptZYsFCUou0eXIUWEnoFHD1nY3NhuPQjDoad995xU92z0BzwduxUAj28liu4=
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 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
- |
if [ "${TX_PASS}" != "" ]
then
echo "[https://www.transifex.com]" >> ~/.transifexrc
echo "hostname = https://www.transifex.com" >> ~/.transifexrc
echo "username = stephane.brunner@camptocamp.com" >> ~/.transifexrc
echo "password = ${TX_PASS}" >> ~/.transifexrc
echo "token =" >> ~/.transifexrc
fi
- export TRAVIS_FOLDER=`pwd`
install:
- if [ ${TRAVIS_PULL_REQUEST} != "false" ] ; then git fetch origin ${TRAVIS_BRANCH}:${TRAVIS_BRANCH}; fi
- travis/no-make-error.sh . help
- 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_requirements.txt <(.build/venv/bin/pip freeze | grep -v '^-e' | grep -v '^#') | grep '^[+-]'
- make -f travis.mk build
- .build/venv/bin/alembic -c c2cgeoportal/tests/functional/alembic.ini heads
- .build/venv/bin/alembic -c c2cgeoportal/tests/functional/alembic_static.ini heads
- travis/create-new-project.sh
- travis/test-upgrade.sh
- travis/build-new-project.sh
script:
- uname -a
- sudo -u postgres psql --version
- node -v
- npm -v
- .build/venv/bin/flake8 --version
- python setup.py --version
# test new project
- |-
cd /tmp/travis/testgeomapfish
.build/venv/bin/pcreate -s c2cgeoportal_update --ignore-conflicting-name --overwrite /tmp/travis/testgeomapfish > /dev/null # on upgrade - don't add any argument on this command
cd -
- travis/no-make-error.sh /tmp/travis/testgeomapfish -f travis.mk help
- find /tmp/travis/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/travis/testgeomapfish/setup.py /tmp/travis/testgeomapfish/testgeomapfish/*.py /tmp/travis/testgeomapfish/testgeomapfish/views -name \*.py | xargs .build/venv/bin/flake8 --max-line-length=100
- find /tmp/travis/testgeomapfish/setup.py /tmp/travis/testgeomapfish/testgeomapfish/*.py /tmp/travis/testgeomapfish/testgeomapfish/views -name \*.py | xargs travis/quote
- travis/test-new-project.sh wsgi/check_collector
- travis/test-new-project.sh wsgi/check_collector?type=all
- travis/status.sh /tmp/travis/testgeomapfish/
- travis/empty-make-new-project.sh
- travis/no-make-error.sh /tmp/travis/testgeomapfish -f travis.mk build
- cp travis/empty-vars.mk /tmp/travis/testgeomapfish/
- travis/run-on.sh /tmp/travis/testgeomapfish/ 'make -f empty-vars.mk .build/config.yaml'
- .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
# test c2cgeoportal
- if [ ${TRAVIS_PULL_REQUEST} != "false" ] ; then git diff --check ${TRAVIS_BRANCH} -- ; fi
- travis/empty-make.sh -f travis.mk build
- travis/no-make-error.sh . 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/python setup.py nosetests --stop --nocapture --nologcapture
- travis/status.sh
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 travis@camptocamp.com
- git config --global user.name Travis
- git remote set-url origin git@github.com:camptocamp/c2cgeoportal.git
before_deploy:
- .build/venv/bin/pip install wheel
- if [[ ${TRAVIS_TAG} =~ ^[0-9]+\.[0-9]+\..+$ ]] ; then
sed -e 's/REQUIREMENTS [\?]= c2cgeoportal/REQUIREMENTS ?= c2cgeoportal=='"${TRAVIS_TAG}"'/g' -i c2cgeoportal/scaffolds/update/CONST_Makefile_tmpl;
sed -e 's/version="[0-9]\+\.[0-9]\+",/version="'"${TRAVIS_TAG}"'",/g' -i setup.py;
git diff;
fi
deploy:
- provider: pypi
user: sbrunner
password:
secure: dT4Z3Zk2SGq1BPl+mX2iI0ubK7veSPb1b0fGrKHpvC3gBxuGUDMhtHw5dgopdWWeUhZLzLoPpEZPyCHtJhE2vunGwZfmJXkrqp/yC1meszZpDgBkpRWzx62u/f1+FmUdGPukvlqTfzgl/vJwertPRzX9Y4hanoFIDQvIKnp37Ls=
skip_cleanup: true
distributions: sdist bdist_wheel
on:
tags: true
python: 2.7
condition: ${TRAVIS_TAG} =~ ^[0-9]+\.[0-9]+\..+$
- &transifex
provider: script
script: make transifex-send
skip_cleanup: true
on:
repo: camptocamp/c2cgeoportal
branch: master
python: 2.7
- <<: *transifex
on:
repo: camptocamp/c2cgeoportal
branch: 2.0
python: 2.7
- provider: script
script: travis/doc.sh
skip_cleanup: true
on:
repo: camptocamp/c2cgeoportal
python: 2.7
notifications:
email:
on_failure: change