forked from Open-Source-GIS/ridepilot
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathREADME
More file actions
84 lines (56 loc) · 2.7 KB
/
Copy pathREADME
File metadata and controls
84 lines (56 loc) · 2.7 KB
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
RidePilot is a paratransit trip scheduling application.
RidePilot is a project of Ride Connection, a Portland-area community
transportation provider. It is primarily written by hackers at
OpenPlans.
-----------------------
To set up postgres for use with RidePilot, you will need the
fuzzystrmatch library (included in postgresql-contrib-8.4 in Ubuntu),
and postgis. This adds support for dmetaphone, which is how we
phonetically match names. Run psql and then the following commands:
-- Create a new database
CREATE DATABASE template_postgis;
-- Make it a template database
UPDATE pg_database SET datistemplate = TRUE WHERE datname = 'template_postgis';
-- Connect to new database and install the pl/pgsql language
\c template_postgis
CREATE LANGUAGE plpgsql;
-- Install PostGIS (your file paths may vary)
\i /opt/local/share/postgresql84/contrib/postgis-1.5/postgis.sql
\i /opt/local/share/postgresql84/contrib/postgis-1.5/spatial_ref_sys.sql
GRANT ALL ON geometry_columns TO PUBLIC;
GRANT ALL ON geography_columns TO PUBLIC;
GRANT ALL ON spatial_ref_sys TO PUBLIC;
-- vacuum freeze: it will guarantee that all rows in the database are
-- "frozen" and will not be subject to transaction ID wraparound
-- problems.
VACUUM FREEZE;
-- You'll also want to set up the fuzzy string matching functions
\i /opt/local/share/postgresql84/contrib/fuzzystrmatch.sql
-----------------------
make sure your database.yml contains the line:
template: template_postgis
in the section named common: &common
Then do rake db:create
-----------------------
You will also need ImageMagick (for no good reason, but Paperclip,
which we use for attachments, requires it)
Deployment
==========
This application uses capistrano for deployment. Check out config/deploy.rb
and config/deploy/ for basic deployment recipes and configuration.
Deployment uses key-based authentication. To deploy, you'll need to add your
public key on the staging/production servers so you can run commands as the
"deployer" user.
To set this up, talk to another developer to get your public key on the
machines. If you need to do system administration on the servers, you'll need
your own user accout set up as well.
Once you have SSH access as deployer, you can deploy:
run: `cap [staging|production] deploy`
Remember to push your changes to the main repository first, since the deploy
process pulls from there. Database migrations are currently performed by hand
after deploying.
Deployment gotchas:
Ridepilot staging is on the production server. That means when you go into
rails/ridepilot-staging, you actually have to set RAILS_ENV=production if
you're going to run any commands. It will not affect the real production
app if you're in the right directory.