Skip to content

Instantly share code, notes, and snippets.

@jerivas
Last active August 29, 2015 14:15
Show Gist options
  • Save jerivas/c36c41d25fc78614b18c to your computer and use it in GitHub Desktop.
Save jerivas/c36c41d25fc78614b18c to your computer and use it in GitHub Desktop.
HOWTO: Deploy a Mezzanine site

[CASE 1] Deploying to a brand new server:

  1. Get your sever. Anything that grants you root access works. VPS's like those from Digital Ocean work great and are cheap.
  2. Fill the FABRIC dictionary in local_settings.py. For SSH_USER provide any username you want (not root), and the fabfile can create it for you.
  3. Run fab secure. You simply need to know the root password to your VPS. The new user will be created and you can SSH with that from now on (if needed).
  4. Run fab all. It will take a while, but after this your Mezzanine site will be live.

Notice that not even once you had to manually SSH into your VPS. Note: some server providers need you to login as root once to change the default password they give you. It should be the only time you are required to SSH into the sever.

[CASE 2] If you already have a server, and you already have created a non-root user with sudo privileges:

  1. Fill the FABRIC dictionary in local_settings.py with the info for said user.
  2. Run fab install to install system-wide requirements.
  3. Run fab deploy to deploy your project.

In any case, after you have completed your first deployment, for all subsequent deployments in the same server (either new sites or updates to your existing sites) you only need to run fab deploy.

If you ever push a bug or mistake into production:

  1. Run fab rollback. This will roll back your project files, database, and static files to how they were in the last (working) deployment.
  2. Work on the fixes in your dev machine.
  3. Run fab deploy to push your fixes to production.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment