Heroku Guide - FaqiangMei/MHA-Survey-Portal GitHub Wiki
This page provides instructions for navigating Heroku, managing environment variables, switching user roles, and using the Heroku CLI for the Health project.
- Go to Heroku Dashboard.
- Select the Health project app from your list.
- Use the tabs (Overview, Resources, Deploy, Metrics, Activity, Access, Settings) to manage your app.
- In the Heroku Dashboard, go to your app.
- Click on the Settings tab.
- Reveal Config Vars to view or edit environment variables.
- Add, edit, or delete variables as needed (e.g.,
RAILS_MASTER_KEY,DATABASE_URL, custom flags).
- Some roles (admin, advisor, student) may be controlled by a flag in the database or as an environment variable.
- To quickly switch a role flag (e.g., from 1 to 0):
- Open the Heroku Dashboard > Resources > click "Run Console" (or use Heroku CLI, see below).
- Run a Rails console command, e.g.:
User.find_by(email: '[email protected]').update(role_flag: 1) # or 0
- Alternatively, update the flag via environment variable in Config Vars if your app uses ENV for roles.
-
Login:
heroku login
-
List apps:
heroku apps
-
Open app dashboard:
heroku open -a <app-name>
-
Run Rails console:
heroku run rails console -a <app-name>
-
View logs:
heroku logs --tail -a <app-name>
-
Set config var:
heroku config:set VAR_NAME=value -a <app-name>
-
Get config vars:
heroku config -a <app-name>
- Always be careful when changing environment variables or role flags in production.
- Use the CLI for advanced management and scripting.
- For more, see the Heroku CLI documentation.