forked from camptocamp/c2cgeoportal
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
162 lines (145 loc) · 6.2 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
dist: trusty
sudo: required
language: python
python:
- 2.7
env:
global:
- secure: aZWcHZWV8lN2SNU2fcUsG8+fVQLOxwDUFYDvuftZALebRG2AHINTkbS31sKbeSwS19ZYpjcuVOKC9HxNAlnMxsdO1NvvFEbSJJD/yqq0V4EfTRqptZYsFCUou0eXIUWEnoFHD1nY3NhuPQjDoad995xU92z0BzwduxUAj28liu4=
before_install:
- cat /etc/apt/sources.list.d/*
- rm --recursive --force /home/travis/.nvm
- sudo rm --force /usr/local/bin/docker-compose
- sudo rm --recursive --force /var/lib/apt/lists/*
- sudo apt-get remove --assume-yes --force-yes python-zope.interface postgresql-*
- sudo apt-get install --assume-yes --force-yes aptitude
- curl --silent --location https://deb.nodesource.com/setup_6.x | sudo -E bash -
- sudo aptitude install --assume-yes apache2 libapache2-mod-wsgi libapache2-mod-fcgid tomcat7 nodejs cgi-mapserver
- sudo apt-get install --option Dpkg::Options::="--force-confold" --force-yes --assume-yes docker-engine
- sudo pip install pyignore git+https://github.com/docker/[email protected]#egg=docker docker-compose==1.9.0 requests==2.11.1
- sudo service postgresql stop
# database for the GeoMapFish application
- docker build --tag=geomapfish-db docker/test-db
- docker run --publish=5432:5432 --detach geomapfish-db
- docker build --tag=external-db docker/test-external-db
- docker run --publish=5433:5432 --detach external-db
- |
if [ "${TX_PASS}" != "" ]
then
echo "[https://www.transifex.com]" >> ~/.transifexrc
echo "hostname = https://www.transifex.com" >> ~/.transifexrc
echo "username = [email protected]" >> ~/.transifexrc
echo "password = ${TX_PASS}" >> ~/.transifexrc
echo "token =" >> ~/.transifexrc
fi
- export TRAVIS_FOLDER=`pwd`
- mkdir --parents /tmp/travis/testgeomapfish
- |
if travis/git-modif docker/build
then
docker build --tag=camptocamp/geomapfish_build_dev docker/build
else
docker pull camptocamp/geomapfish_build_dev
fi
- docker build --tag=camptocamp/geomapfish_build .
- |
[[ `./docker-run id` =~ uid=[0-9]+\(travis\)\ gid=[0-9]+\(geomapfish\)\ groups=[0-9]+\(geomapfish\) ]]
install:
- if [ ${TRAVIS_PULL_REQUEST} != "false" ] ; then git fetch origin ${TRAVIS_BRANCH}:${TRAVIS_BRANCH}; fi
- ./docker-run travis/no-make-error.sh . help
- ./docker-run make -f travis.mk build
- pip install sqlalchemy psycopg2
- python travis/waitdb postgres://www-data:www-data@localhost/geomapfish_test
- travis/create-new-project.sh
- travis/test-upgrade.sh
- travis/build-new-project.sh
script:
- uname --all
- node --version
- npm --version
- python setup.py --version
- docker version
# test return code
- ./docker-compose-run true
- |
if ./docker-compose-run false
then
false
fi
# test new project
- cd /tmp/travis/testgeomapfish
- .build/venv/bin/pcreate --scaffold=c2cgeoportal_update --ignore-conflicting-name --overwrite /tmp/travis/testgeomapfish > /dev/null # on upgrade - do not add any argument on this command
- make -f travis.mk checks
- cd $TRAVIS_FOLDER
- travis/no-make-error.sh /tmp/travis/testgeomapfish -f travis.mk help
- 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 wsgi/check_collector
- travis/test-new-project wsgi/check_collector?type=all
- travis/test-new-project wsgi/layers/test/values/type enum
- 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'
- ./docker-compose-run alembic --config c2cgeoportal/tests/functional/alembic.ini upgrade head
- ./docker-compose-run alembic --config c2cgeoportal/tests/functional/alembic_static.ini upgrade head
- ./docker-compose-run alembic --config c2cgeoportal/tests/functional/alembic_static.ini downgrade base
- ./docker-compose-run alembic --config c2cgeoportal/tests/functional/alembic.ini downgrade base
# test c2cgeoportal
- ./docker-run travis/empty-make.sh -f travis.mk build
- ./docker-run travis/no-make-error.sh . -f travis.mk build
- ./docker-run make -f travis.mk doc
- ./docker-run make -f travis.mk checks
- ./docker-run make -f travis.mk c2cgeoportal/tests/functional/alembic.ini
- ./docker-compose-run alembic --config c2cgeoportal/tests/functional/alembic.ini upgrade head
- ./docker-compose-run alembic --config c2cgeoportal/tests/functional/alembic_static.ini upgrade head
- ./docker-compose-run nosetests
after_success:
- ./docker-run 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
- GIT_REV=`git log | head --lines=1 | awk '{{print $2}}'`
- |
if [ "${TRAVIS_REPO_SLUG}-${TRAVIS_PULL_REQUEST}" == camptocamp/c2cgeoportal-false ]
then
travis/doc.sh
fi
before_deploy:
- git checkout ${GIT_REV}
- if [[ ${TRAVIS_TAG} =~ ^[0-9]+\.[0-9]+\..+$ ]] ; then
sed --expression 's/REQUIREMENTS [\?]= c2cgeoportal/REQUIREMENTS ?= c2cgeoportal=='"${TRAVIS_TAG}"'/g' --in-place c2cgeoportal/scaffolds/update/CONST_Makefile_tmpl;
sed --expression 's/version="[0-9]\+\.[0-9]\+",/version="'"${TRAVIS_TAG}"'",/g' --in-place setup.py;
git diff;
fi
deploy:
- provider: pypi
user: sbrunner
password:
secure: dT4Z3Zk2SGq1BPl+mX2iI0ubK7veSPb1b0fGrKHpvC3gBxuGUDMhtHw5dgopdWWeUhZLzLoPpEZPyCHtJhE2vunGwZfmJXkrqp/yC1meszZpDgBkpRWzx62u/f1+FmUdGPukvlqTfzgl/vJwertPRzX9Y4hanoFIDQvIKnp37Ls=
skip_cleanup: true
skip_upload_docs: true
distributions: sdist bdist_wheel
on:
repo: camptocamp/c2cgeoportal
tags: true
condition: '"${TRAVIS_TAG}" =~ ^[0-9]+\.[0-9]+\..+$'
- provider: script
script: docker-run make transifex-send
skip_cleanup: true
on:
repo: camptocamp/c2cgeoportal
branch: 2.1
condition: '"${TRAVIS_PULL_REQUEST}" = false'
- provider: script
script: travis/doc.sh
skip_cleanup: true
on:
repo: camptocamp/c2cgeoportal
branch: 2.1
condition: '"${TRAVIS_PULL_REQUEST}" = false'
notifications:
email:
on_failure: change