[CASE 1] Deploying to a brand new server:
- Get your sever. Anything that grants you root access works. VPS's like those from Digital Ocean work great and are cheap.
- Fill the
FABRIC
dictionary inlocal_settings.py
. ForSSH_USER
provide any username you want (not root), and the fabfile can create it for you. - 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). - 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:
- Fill the
FABRIC
dictionary inlocal_settings.py
with the info for said user. - Run
fab install
to install system-wide requirements. - 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:
- Run
fab rollback
. This will roll back your project files, database, and static files to how they were in the last (working) deployment. - Work on the fixes in your dev machine.
- Run
fab deploy
to push your fixes to production.