forked from vrk-kpa/opendata
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
60 lines (55 loc) · 2.98 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
language: python
python:
- "2.7"
branches:
only:
- master
- beta
- /^release-.*$/
- ci-testing
notifications:
flowdock: 4c5e3d825b1a21302c14ae60aaf9e36c
cache:
directories:
- /usr/lib/ckan/default/src/
- $HOME/cache
apt: true
before_install:
- sudo apt-get update
install:
- pip install ansible==1.6.10
- pip install flake8
- pip install coverage
before_script:
- chmod +x ./scripts/travis-flake.sh
- ./scripts/travis-flake.sh
- psql -c "create user ckan_default with password 'pass';" -U postgres
- psql -c "create user datastore_database_default with password 'pass';" -U postgres
- psql -c "create user ckan_test with password 'pass';" -U postgres
- psql -c "create user drupal with password 'drupal';" -U postgres
- psql -c "create database ckan_default WITH OWNER ckan_default;" -U postgres
- psql -c "create database datastore_default WITH OWNER ckan_default;" -U postgres
- psql -c "create database ckan_test WITH OWNER ckan_default" -U postgres
- psql -c "create database drupal;" -U postgres
- psql -c "create extension postgis;" -U postgres
- psql -d "datastore_default" -c "create role datastore_default;"
- psql -d ckan_default -f /usr/share/postgresql/9.3/contrib/postgis-2.1/postgis.sql -U postgres
- psql -d ckan_default -f /usr/share/postgresql/9.3/contrib/postgis-2.1/spatial_ref_sys.sql -U postgres
- psql -d "ckan_default" -c "ALTER VIEW geometry_columns OWNER TO ckan_default;" -U postgres
- psql -d "ckan_default" -c "ALTER TABLE spatial_ref_sys OWNER TO ckan_default;" -U postgres
- psql -d "datastore_default" -c "REVOKE CREATE ON SCHEMA public FROM PUBLIC;"
- psql -d "datastore_default" -c "REVOKE USAGE ON SCHEMA public FROM PUBLIC;"
- psql -d "datastore_default" -c "GRANT CREATE ON SCHEMA public TO ckan_default;"
- psql -d "datastore_default" -c "GRANT USAGE ON SCHEMA public TO ckan_default;"
- psql -d "datastore_default" -c "GRANT CREATE ON SCHEMA public TO datastore_database_default;"
- psql -d "datastore_default" -c "GRANT USAGE ON SCHEMA public TO datastore_database_default;"
- psql -d "datastore_default" -c "REVOKE CONNECT ON DATABASE ckan_default FROM datastore_default;"
- psql -d "datastore_default" -c "GRANT CONNECT ON DATABASE datastore_default TO datastore_default;"
- psql -d "datastore_default" -c "GRANT USAGE ON SCHEMA public TO datastore_default;"
- psql -d "datastore_default" -c "GRANT SELECT ON ALL TABLES IN SCHEMA public TO datastore_default;"
- psql -d "datastore_default" -c "ALTER DEFAULT PRIVILEGES FOR USER datastore_database_default IN SCHEMA public GRANT SELECT ON TABLES TO datastore_default;"
script:
- "ansible-playbook -i travis/travis-ansible-inventory ansible/single-server.yml --syntax-check"
# Run the role/playbook with ansible-playbook.
- "ansible-playbook -i travis/travis-ansible-inventory -v ansible/travis-server.yml --connection=local --sudo --skip-tags=has-hostname,non-local,firewall"
- sudo ./scripts/travis-test.sh