Deployment

This is a quick-and-dirty page explaining how to deploy new versions of the OpenHatch code.

Prerequisites

  • You must be part of the Login Team (so your SSH key is available in Github and you’re in the openhatch-committers group, and also that your SSH key is in the deploy@linode.openhatch.org account’s .ssh/authorized_keys)
  • You must be at a computer with that SSH key
  • Deploying takes about 3 minutes, maybe less if things go well. (If there are database migrations to run, it can take dramatically longer.)

How the deploy script works

You need to have these programs installed: ssh, git.

The script does two things:

  • Pushes the current local master branch to Heroku.
  • SSHes to the two linodes, where it runs mysite/scripts/deploy_myself.sh which updates the site.

Notes about the deployment

Here are some relevant details of how web requests get routed to the OpenHatch code.

  • Web requests hit CloudFlare, which proxies them to Heroku (for openhatch.org and www.openhatch.org) or linode.openhatch.org (for other OpenHatch sites, like wiki.openhatch.org).
  • linode.openhatch.org has an nginx that handles some requests itself, and dispatches others to Apache.
  • In production, we use a mysite/local_settings.py file that imports mysite/deployment_settings.py and overrides the Django SECRET_KEY, DATABASE_URL, and a few other settings.

Other sites we host

The OpenHatch organization hosts some other websites, including bostonpythonworkshop.com and corp.openhatch.org. For information about that, read the documentation on the wiki about static site hosting.