Skip to content
This repository was archived by the owner on Oct 2, 2019. It is now read-only.

Commit a9de5f3

Browse files
committed
Merge pull request #191 from 18F/db-init
Allow DB config during development
2 parents ce0b706 + fbd0037 commit a9de5f3

File tree

3 files changed

+18
-15
lines changed

3 files changed

+18
-15
lines changed

.env.example

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ SMTP_USERNAME: [email protected]
66
# optional
77
#
88
# DB_NAME
9+
# DB_HOST
10+
# DB_PASSWORD
11+
# DB_PORT
12+
# DB_USERNAME
913
# DEFAULT_URL_HOST
1014
# DEFAULT_URL_PORT
1115
# DEFAULT_URL_SCHEME
@@ -18,8 +22,4 @@ SMTP_USERNAME: [email protected]
1822

1923
# production only
2024
#
21-
# DB_HOST
22-
# DB_PASSWORD
23-
# DB_PORT
24-
# DB_USERNAME
2525
# SECRET_TOKEN

README.md

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,21 +41,25 @@ cd C2
4141
To get the database and tests running:
4242

4343
1. Install Node.js 0.10
44-
1. Start PostgreSQL.
44+
1. Start PostgreSQL. You will need to be able to create databases; set the
45+
`DB_`* variables in your environment if needed.
4546
1. Run `script/bootstrap`, which will print "DONE" if successful. *NOTE: This will delete any existing records in your C2 database.*
4647
1. Run the specs with `bundle exec rspec spec` at the command line.
4748
* To run tests automatically as files are changed, run `bundle exec guard`.
4849
1. Run the frontend tests with `grunt jasmine`.
4950

5051
To see previews of the mailers:
5152

52-
* Start the server, and visit http://localhost:3000/mail_view/.
53+
* Start the server (`bundle exec rails server`), and visit http://localhost:3000/mail_view/.
5354

5455
To get the app running:
5556

56-
1. Register an application on [MyUSA](https://myusa-staging.18f.us/authorizations)
57-
1. Modify [`.env`](.env.example)
57+
1. Register an application on [MyUSA](https://myusa-staging.18f.us/authorizations).
58+
Note that your application will need access to the user's email.
59+
1. Modify [`.env`](.env.example). In particular, be sure to set the `MYUSA_KEY`
60+
and `MYUSA_SECRET` values based on the above and set `MYUSA_URL` to
61+
`https://myusa-staging.18f.us`.
5862

5963
## More info
6064

61-
* [Capistrano commands](docs/capistrano.md)
65+
* [Capistrano commands](doc/capistrano.md)

config/database.yml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,12 @@ default: &default
22
adapter: postgresql
33
encoding: unicode
44
database: <%= ENV['DB_NAME'] || "c2_#{Rails.env}" %>
5-
pool: 5
6-
7-
development: *default
8-
test: *default
9-
production:
10-
<<: *default
115
username: <%= ENV['DB_USERNAME'] %>
126
password: <%= ENV['DB_PASSWORD'] %>
137
host: <%= ENV['DB_HOST'] %>
148
port: <%= ENV['DB_PORT'] %>
9+
pool: 5
10+
11+
development: *default
12+
test: *default
13+
production: *default

0 commit comments

Comments
 (0)