diff --git a/README.md b/README.md index eb14a3ff8b6..04affce0913 100644 --- a/README.md +++ b/README.md @@ -51,7 +51,7 @@ npx sequelize db:migrate At this point you should be ready to go! The app is compiled into a bundle and pushed to Heroku, which -serves it at commonwealthapp.herokuapp.com. **Migrations are +serves it at .herokuapp.com. **Migrations are automatically executed.** If migrations do not complete successfully, the new backend does not get served. @@ -64,6 +64,18 @@ NODE_ENV=production yarn build NODE_ENV=production yarn start ``` +To copy the production database to the staging database for testing purposes, ensuring migrations will work: +``` +# turn off the web dynos in staging +heroku maintenance:on -a +# backup the staging database in case of an error +heroku pg:backups capture -a +# copy db from production app database url to staging url +heroku pg:copy :: -a +# turn on the web dynos in staging +heroku maintenance:off -a +``` + ## Environment Variables You should create a `.env` file in the root of the repository @@ -113,7 +125,7 @@ brew tap heroku/brew && brew install heroku Setting up a server environment: ``` -heroku git:remote --app commonwealthapp +heroku git:remote --app heroku config:set [Set up session secrets, API keys, OAuth tokens, etc.] yarn deploy ```