forked from fitnr/gtfs-sql-importer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis.yml
62 lines (53 loc) · 1.95 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
dist: bionic
language: minimal
services:
- postgresql
addons:
postgresql: "10"
apt:
packages:
- postgresql-10
- postgresql-client-10
git:
depth: 3
env:
global:
- PGUSER=postgres
- PGDATABASE=postgres
matrix:
- FEED=greater-cleveland-regional-transit-authority/214
- FEED=abq-ride/52
- FEED=connecticut-transit/323/gtfs.zip
- FEED=actv/631
- FEED=transperth/2
- FEED=greenbus-thailand/784
- FEED=subterraneos-de-buenos-aires/541
before_install:
- make --version
- psql --version
- /bin/bash -c "DEBIAN_FRONTEND=noninteractive sudo apt-get install -y tzdata"
- sudo ln -fs /usr/share/zoneinfo/America/New_York /etc/localtime
- sudo dpkg-reconfigure --frontend noninteractive tzdata
- sudo apt-get update -qq
- sudo apt -y install gnupg2
- find /usr -name postgis.control
# Install postgis install from postgres repo
- wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
- echo "deb http://apt.postgresql.org/pub/repos/apt/ `lsb_release -cs`-pgdg main" |sudo tee /etc/apt/sources.list.d/pgdg.list
- sudo apt -y install postgresql-10-postgis-2.4 postgresql-10-postgis-2.4-scripts
- find /usr -name postgis.control
# download latest GTFS data
- curl -Lo gtfs.zip http://transitfeeds.com/p/${FEED}/latest/download
- sudo sed -i -e '/local.*peer/s/postgres/all/' -e 's/peer\|md5/trust/g' /etc/postgresql/*/main/pg_hba.conf
- sudo service postgresql restart
- sleep 1
before_script:
- psql -U postgres -c "create extension postgis"
- make -e init
- make -e drop_constraints
script: make --warn-undefined-variables -e load GTFS=gtfs.zip
after_script:
- make -e add_constraints
- psql -U postgres -c "SELECT * FROM gtfs.feed_info"
- psql -U postgres -c "SELECT feed_index, trip_id, stop_id, stop_sequence, shape_dist_traveled FROM gtfs.stop_times LIMIT 10"
- psql -U postgres -c "SELECT feed_index, shape_id, length FROM gtfs.shape_geoms LIMIT 10"