Staging and production environments
We're using Heroku as a hosting provider. Deploying to Heroku is done via git. So, set up your git remotes for each environment:
git remote add staging firstname.lastname@example.org:your-app-staging.git git remote add production email@example.com:your-app-production.git
The following are mostly aliases from the
To access your code on Heroku:
That will drop you into a Rails console for either environment. You can run ActiveRecord queries from there.
To dump staging or production data into your development environment:
You will see progress bars for each db index and table.
We can create a database backup at any time:
To destroy a backup:
heroku pgbackups:destroy b003 --remote production
Transfer production data to staging:
More information in the Dev Center.
To check the status of running app servers, background jobs, cron jobs, etc:
To see the performance of the staging application, see:
To see the performance of the production application, see:
ENV variables like AWS keys should not be in the source code. They are configuration and should be stored as ENV variables. On Heroku, they are called "config variables." You can pull config variables using the
heroku-config plugin that comes with the
heroku config:pull --remote staging
You'll see the Amazon credentials as config vars. You should delete lines that don't apply, like Redis to Go connection strings.