forked from QGEP/datamodel
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.travis.yml
72 lines (58 loc) · 3.23 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
language: python
python:
- 3.5
addons:
postgresql: "9.6"
install:
- pip install -r requirements.txt
env:
# QGEP-Ninja token
secure: "qG+4iP4R+SLTGz9/ulzSOz76pT1XCnOWAAuS1QlUm6Gn8WzDdAgMaHS4c0JcfxYs+gq+2LMNzDJx+HzHnQBgXmUCLars4LDOh3ov2+xOCcCWjE6BY5HyXDMp6gW0kMCL72JWSNLiI2Y0cy7uGd2Wgu1i0zI6gx9f6kLZYp0HJNEZ0PYEtokxKph9ijKXPwU8WwldvDJz4DzpOt8pRrL3uFJNIIZJjG50gIu0X/iDDyJayAKbCqAlYsjyAMeCZE3qpYtcoo8Di8CD98yhnKVKTPPk3ftvpR9MHtfnWNCbAZrJ+tZycTPKYp0MZZ642WZhpFuNHZHvg0vJO2kifcYP7NF1feyd6bNKm+jtcDWC7FrHAhqmxGad+et7Fvs7XuLYZdx6XJjFP1bumHxxRqUrt6TcE+4UoBVTGupa94V/RBO5xM3YGNzky8Aj8EyypQqscPPZplDNKQzxbGa3dSQu5G1IrHkzigiKrr7zsraPp+m4X3gWmwo4htxaGFgUzTINQ3FnG5kGe4g1R7F5JwbTcsAcPR+KRJvF0jT6t5Pntqjd0YBhfp0mYxfpZb+wRSdM6GXMPiZuqunqAQPNSnFX9CBAEw/OrVpndiN5QPETmSIsr32SBF6qilldVEy03qRKvni4JmXBiB5OypmxNMSL0YmZ9cOT3+oQ5g0RERQV2ZU="
# Handle git submodules yourself
git:
submodules: false
# Use sed to replace the SSH URL with the public URL, then initialize submodules
before_install:
- |
echo "Setting up readonly access via https"
sed -i 's|git@github.com:|https://github.com/|' .gitmodules
echo "Setting up git for bot"
git config --global user.email "qgep@opengis.ch"
git config --global user.name "QGEP-Ninja"
git config --global push.default simple
git submodule update --init --recursive
before_script:
- sudo apt-get -qq update
- sudo apt-get purge oracle-java9-installer oracle-java8-installer
- sudo apt-get autoremove -y postgresql-9.2 postgresql-9.3 postgresql-9.4 postgresql-9.5
- sudo -E apt-get -yq install postgresql-9.6-postgis-2.4
- sudo -E apt-get -yq --allow-unauthenticated upgrade postgresql-client-9.6
- |
for pgsrv in pg_qgep qgep_prod qgep_test qgep_comp; do
printf "[${pgsrv}]\nhost=localhost\ndbname=${pgsrv}\nuser=postgres\n" >> ~/.pg_service.conf
psql -c "CREATE DATABASE ${pgsrv};" -U postgres
psql -c "CREATE EXTENSION postgis;" -U postgres -d ${pgsrv}
psql -c "CREATE EXTENSION hstore;" -U postgres -d ${pgsrv}
done
psql -c "CREATE GROUP qgep;" -U postgres
psql -c "CREATE ROLE qgepuser LOGIN;" -U postgres
psql -c "GRANT qgep TO qgepuser;" -U postgres
script:
- $TRAVIS_BUILD_DIR/scripts/db_setup.sh -r > /dev/null
- nosetests -e test_import.py -e test_geometry.py
# Get current version
- export VERSION=$(sed 'r' "$TRAVIS_BUILD_DIR/system/CURRENT_VERSION.txt")
# Create a db from a dump file. This simulate the prod db
- pum restore -p qgep_prod -x --exclude-schema public --exclude-schema topology -- $TRAVIS_BUILD_DIR/test_data/qgep_demodata_1.0.0.dump
- pum baseline -p qgep_prod -t qgep_sys.pum_info -d $TRAVIS_BUILD_DIR/delta/ -b 1.0.0
# Create last version of qgep db using db_setup.sh script as comp db
- export PGSERVICE=qgep_comp
- $TRAVIS_BUILD_DIR/scripts/db_setup.sh > /dev/null
- pum baseline -p qgep_comp -t qgep_sys.pum_info -d $TRAVIS_BUILD_DIR/delta/ -b $VERSION
# Run pum's test and upgrade
- yes | pum test-and-upgrade -pp qgep_prod -pt qgep_test -pc qgep_comp -t qgep_sys.pum_info -d $TRAVIS_BUILD_DIR/delta/ -f /tmp/qwat_dump -i constraints views --exclude-schema public -v int SRID 2056
# Run tests on qgep_prod
- export PGSERVICE=qgep_prod
- nosetests -e test_views.py
after_success:
- ./.deploy/create-release.py