Typical deployment steps

Imagine that you have a medium-sized web application deployed on a single web server. Git has been chosen as the version control and collaboration tool. A central repository that is shared with all users has been created in the form of a bare Git tree.

Let's assume that your production server has been fully set up. When you run your Fabric deployment command, say, fab deploy, the following scripted sequence of actions take place:

  1. Runs all tests locally
  2. Commits all local changes to Git
  3. Pushes to a remote central Git repository
  4. Resolves merge conflicts, if any
  5. Collects the static files (CSS, images)
  6. Copies the static files to the static file server
  7. At the remote host, pulls changes from a central Git repository
  8. At the remote host, runs (database) migrations
  9. At the remote host, touches app.wsgi to restart WSGI server

The entire process is automatic and should be completed in a few seconds. By default, if any step fails, then the deployment gets aborted. Though not explicitly mentioned, there would be checks to ensure that the process is idempotent.

Fabric is not yet compatible with Python 3, though the developers are in the process of porting it. In the meantime, you can run Fabric in a Python 2.x virtual environment or check out similar tools, such as PyInvoke.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset