How do I set up buildout for an existing Plone site?

by Christopher Johnson last modified Jan 20, 2009 02:43 PM
Buildout is a very easy way to set up GetPaid and all its dependencies, and it makes it easy for you to maintain your site with the latest code. Buildout sets up all of the things you need, including an instance.

Note: there is also a recipe you can use. See the howto about adding the recipe to your buildout.

Purpose

This document explains how to use buildout in the case you have an existing Plone site and want to set up GetPaid.

For development and deployment, buildout is much better at actually creating an environment where components are installed in standard locations and does a good job isolating any system quirks.

Prerequisities

  • A Plone 3.0 site (may work as well for 2.5, but I didn't personally test it)
  • Server access (ssh)

Step by step

  • First install a plain old Plone instance (you've probably already done this if you're reading this document) using the Unified Installer or Windows Installer from plone.org/products/plone
  • If you've just installed a new instance, navigate to it, run your buildout and confirm your site runs as expected.  If your
    bin/buildout
    bin/instance fg
    
  • Now there a few bits and pieces to add to your buildout.cfg.  Be sure to take note of the section headings so that you paste these lines into the right spot in your file.
    [buildout]
    # Add a new part that takes care of some housekeeping
    parts =
       ...
       getpaid-cleanup
    
    # Add the eggs required by GetPaid
    eggs =
       ...
       dateutil
       simplejson
       zc.ssl
    
    # Set the bundle you'd like to use.  Change this to use more recent versions.
    [productdistros]
    ...
    urls =
       ...
       http://getpaid.googlecode.com/files/PloneGetPaid-bundle-0.6.1.tar.gz
    
    # A section to move some GetPaid files into the appropriate location after their initial download
    [getpaid-cleanup]
    recipe = plone.recipe.command
    update-command = $[getpaid-cleanup:command]
    command = 
        if [ -d ${buildout:directory}/parts/productdistros/PloneGetPaid-bundle/Products/PloneGetPaid/ ];
        then 
        echo 'moving PloneGetPaid packages...';
        mv ${buildout:directory}/parts/productdistros/PloneGetPaid-bundle/Products/PloneGetPaid/  \
        ${buildout:directory}/parts/productdistros/PloneGetPaid/;
        
        echo 'moving libs for PloneGetPaid...';
        mv ${buildout:directory}/parts/productdistros/PloneGetPaid-bundle/lib/python/five/ \
        ${buildout:directory}/parts/zope2/lib/python/five/;
        
        mv ${buildout:directory}/parts/productdistros/PloneGetPaid-bundle/lib/python/gchecky/ \
        ${buildout:directory}/parts/zope2/lib/python/gchecky/;
        
        mv ${buildout:directory}/parts/productdistros/PloneGetPaid-bundle/lib/python/getpaid/ \
        ${buildout:directory}/parts/zope2/lib/python/getpaid/;
        
        mv ${buildout:directory}/parts/productdistros/PloneGetPaid-bundle/lib/python/hurry/ \
        ${buildout:directory}/parts/zope2/lib/python/hurry/;
        
        mv ${buildout:directory}/parts/productdistros/PloneGetPaid-bundle/lib/python/ore/ \
        ${buildout:directory}/parts/zope2/lib/python/ore/;
        
        mv ${buildout:directory}/parts/productdistros/PloneGetPaid-bundle/lib/python/yoma/ \
        ${buildout:directory}/parts/zope2/lib/python/yoma/;
        
        mv ${buildout:directory}/parts/productdistros/PloneGetPaid-bundle/lib/python/zc/ \
        ${buildout:directory}/parts/zope2/lib/python/zc/;
        fi
  • Now rerun buildout
    bin/buildout
    and you should be all set to go.

 

Further information

Thanks to Horacio (perrito) and AdamAtNCPC for the solution.

As always, the DevGettingStarted page in the GetPaid wiki has a lot of great information.