-
Notifications
You must be signed in to change notification settings - Fork 1
Import GTFS
Molly O'Neil edited this page Aug 6, 2018
·
4 revisions
Hi friends,
This is how I import GTFS data! There are several different ways to do so; this is for anyone who needs concrete steps.
First, deploy to the server if you've made any changes to the relevant rake tasks (bus stops route import or route import). Follow these steps to do so:
-
git pull origin master
in order to make sure your master is up to date. cap production deploy
So, the server should now be up-to-date. Onto running rake tasks on the server.
- Move the appropriate files to the server with
scp Downloads/gtfs.zip [email protected]:/srv/stop-project/current/
- Connect to Pulse Secure through
transportation
(or whatever it's named on your computer), then connect to the realmaf-umts
. -
ssh af-transit-app3.admin.umass.edu
(or whatever it is in your ssh config) - Go into the proper directory to run tasks
cd /srv/stop-project/current
- Unzip the directory we copied to the server:
unzip gtfs.zip
- Perform the following rake tasks:
RAILS_ENV=production SECRET_KEY_BASE=penny bundle exec rake 'routes:import[routes.txt]'
-
RAILS_ENV=production SECRET_KEY_BASE=penny bundle exec rake bus_stops_routes:import’
Some things to note: The first task requires atxt
file, but the second one doesn't. Also, I needed to include something forSECRET_KEY_BASE
, but you might not need to.
- Sanity Check (Not necessary, but recommended)
RAILS_ENV=production SECRET_KEY_BASE=bananas bundle exec rails c
- Check that there are roughly twice as many
bus_stops_routes
as there arebus_stops
. -
routes
are also deleted in the first rake task, so make sure there are some.