Managing Production - PatrickF1/GraceTunes GitHub Wiki

Heroku Setup

First, install the Heroku CLI and login

brew install heroku
heroku login

Then, link the local repository to Heroku by running this in the root directory of the repository

heroku git:remote -a gracetunes

If you already had the staging app set up, you may want to set a default heroku remote to avoid having to provide the --app option for every heroku command.

Deployment

git push gracetunes

If there are DB migrations to run

heroku run rails db:migrate
heroku restart

Rollback by going to the Heroku UI > Overview > All activity > Roll back to here. Can also go through CLI but not as simple.

Useful Commands

Set config vars using this command. Remember that whenever config vars are changed, the app is automatically restarted.

heroku config:set KEY1=VALUE1 KEY2=VALUE2

psql into the production database

heroku pg:psql

Debugging

Tail the logs with

heroku logs --tail

Open logtail

heroku addons:open logtail

Could it be a Heroku outage? See https://status.heroku.com/

Other

Google API

GraceTunes using Google's OAuth to authenticate users. The credentials are located here. To get access to them, ask Patrick.

Route 53

GraceTune's domain is managed in Route 53. The entries have a TTL of 2 days. Contract Bryant Cheung for help managing it.

SSL Certs

These are managed by Heroku.