Skip to content

Deployment

Donald Dong edited this page Feb 25, 2019 · 2 revisions

Deployment needs to be done for the frontend and backend separately and in this order. Deploying is a privileged operation so be careful.

Environment Variables

We need to have access to those environment variables when we deploy

  • PARROT_AWS_KEY_ID: The AWS key ID. The deployment script requires it to connect to AWS resources.
  • PARROT_AWS_KEY_SECRET: The AWS key secret. The deployment script requires it to connect to AWS resources.
  • PARROT_CDN_BUCKET: Identify the s3 bucket we used for the CDN.
  • PARROT_CDN_DIST: Identify the CloudFront distro we used for the CDN.
  • PARROT_CDN_HOST: The CDN host for the static assets.
  • PARROT_ENV: The development environment. Currently it can be development (default) or production.
  • PARROT_HOST: Whitelist the main host in production.

Note: we don't want to share the values of many of these variables publicly (e.g. PARROT_AWS_KEY_ID and PARROT_AWS_KEY_SECRET) or there may be disastrous consequences.

Deploy the frontend

To deploy the frontend, one must build the frontend first

npm run build -C frontend

Then run the script to deploy it.

python scripts/deploy_frontend.py

Deploy the backend

We need only need to push it to Heroku.

git push heroku master -f

where heroku is a git remote pointing to https://git.heroku.com/progteam-parrot.git.

Clone this wiki locally