Don't fear the zc.buildout

Yet another introduction to zc.buildout.

Lightning-talk for DjangoCon-Toulouse 2012, by Benoît Bryon.


Slides available at http://tech.novapost.fr

Presenter Notes

The deployment pattern

Have you ever...

  • executed commands
  • shared them as a script
  • made the script configurable to support several environments...
  • ... and even more configurable to support several projects
  • released all this work publicly
  • accepted third-party plugins

Presenter Notes

(zc.) buildout

  • core provides configuration parser and recipes runner
  • recipes are deployment scripts (install, uninstall, update)
  • extensions are pluggable batteries

Presenter Notes

buildout.cfg

[buildout]
parts =
    hello-world
    activate

[hello-world]
recipe = z3c.recipe.usercrontab
times = 0 7 * * *
command = echo "Hello world"

[activate]
recipe = evg.recipe.activate

Many recipes are available on PyPI

Presenter Notes

Install Python software

[buildout]
parts = someproject

[someproject]
recipe = z3c.recipe.scripts
eggs =
    bpython
    Sphinx
    someproject
include-site-packages = True
allowed-eggs-from-site-packages = lxml

Have a look at generated scripts in bin/ folder: per-script sys.path tuning.

Presenter Notes

The more projects, the more benefits

  • Repeatable: configuration-driven
  • Predictable: does what is expected, or reports errors
  • Extensible: extensions and recipes are Python packages
  • Isolated: everything lives in workspace
  • Portable: Python

Great for teams and open-source projects.

Presenter Notes

Typical usage

  • Deploy Python environments
  • on local machines
  • with a single user

Run buildout in your (make/fabric/salt/chef/puppet) deployment strategy.

Presenter Notes