- Fork & clone the repository locally!
- Install Ruby version 3.0.3, and switch to that version using
rvm use 3.0.3
- Run
bundle install --without production
- Run
db:schema:load
&rake db:migrate
- Follow these instructions to create & setup a new Heroku app on the CLI
- You must have PostgreSQL installed locally to run the rails server. Then, you must start the server via the command line
- For Mac: Run
brew services start postgresql
- For Windows: Run
pg_ctl -D "C:\Program Files\PostgreSQL\9.6\data" start
- For Mac: Run
- Our code requires 4 environment variables to work correctly in production & local environments.
- For local development: You must set a non-empty string for the environment variables
ADMIN
,STAFF
,GOOGLE_CLIENT_ID
, and `GOOGLE_CLIENT_SECRET- For Mac: With Terminal open, run
open ~/.bash_profile
- At the bottom of the text file, add the following:
export ADMINS=string
&export STAFF=string
where string is a comma-separated list of Berkeley email addresses (these do not have to be real); i.e.person@berkeley.edu,person2@berkeley.edu
Additionally, addexport GOOGLE_CLIENT_ID=some_value
&export GOOGLE_CLIENT_SECRET=some_value
where some_value is some arbitrary string (these do not need to be valid to run the app locally, since google authentication is stubbed-out unless it is run on production). - For Windows: follow these instructions to set environment variables
- Set
ADMINS
&STAFF
, where the value of each is a comma-separated list of Berkeley email addresses (these do not have to be real); i.e.person@berkeley.edu,person2@berkeley.edu
. - Set
GOOGLE_CLIENT_ID
&GOOGLE_CLIENT_SECRET
to some arbitrary string (these do not need to be valid to run the app locally, since google authentication is stubbed-out unless it is run on production).
- For Mac: With Terminal open, run
- For production: Add the above environment variables to Heroku via the command line (assuming there is a Heroku app set up in your directory)
- Follow these instructions (web app) to obtain a google client secret & a google client ID. For the callback URL, use https://your-app-name.herokuapp.com/auth/google_oauth2/
- Use the command
heroku config:set VARIABLE=value
- Add
ADMINS
&STAFF
set to a comma-separated list of verified administrators and staff members for the app. For testing purposes, these variables can both be set to the string”none”
- Add
GOOGLE_CLIENT_SECRET
&GOOGLE_CLIENT_ID
as provided by the instructions above.
- In order for the GitHub Actions build to pass, you must add a
CC_TEST_REPORTER_ID
as a repository secret on GitHub. To do this, first sign up for an account with codeclimate.com (quality, not velocity). Then, connect your repository and navigate to repo settings on the CodeClimate dashboard. Finally, copy thetest reporter ID
under the test coverage tab, and add it as a new repository secret under repository settings on GitHub.
- That’s all! The app should now run on your local environment and any Heroku apps created from the codebase.