Buildout recipes for PasteDeploy

Sponsored by:2degrees Limited.
Latest release:1.0.1

Overview

DeployRecipes aims to be a collection of Buildout recipes to integrate PasteDeploy.

The recipes

confvars: Load options from PasteDeploy configuration files

The confvars recipe loads the options from a PasteDeploy configuration file into a Buildout part, so you can define variables in a single place and use them within your Buildout configuration.

The URI given must be absolute or relative to the Buildout directory.

Example

Say you have the following PasteDeploy config:

# /path/to/config.ini
[DEFAULT]
debug = false

[app:main]
use = egg:yourpackage
database_name = db1
database_password = passw0rd

You may want to reuse the database_name and database_password options in a recipe that sets the database up. In that case, you would use a Buildout configuration file like the one below:

[buildout]
parts = setup_db

[paste_vars]
recipe = deployrecipes:confvars
config_uri = config:/path/to/config.ini
factory_distribution = yourpackage

[setup_db]
recipe = your_recipe_to_setup_the_database
database_name = ${paste_vars:database_name}
database_password = ${paste_vars:database_password}

Or just:

[buildout]
parts = setup_db

[paste_vars]
recipe = deployrecipes:confvars
config_uri = config:/path/to/config.ini
factory_distribution = yourpackage

[setup_db]
<= paste_vars
recipe = your_recipe_to_setup_the_database

This recipe internally uses zc.recipe.egg, so you could use any of its options if you need it.

Attention

It’s mandatory to set the factory_distribution option to the package that provides the PasteDeploy application factory! Otherwise you will get import errors (DistributionNotFound).