0

I'm loosely following Martin Aspeli's book Professional Plone 4 Development and have a repeatable deployment using buildout. In order to make everything completely automated, I'd like to be able to run bin/buildout and find the site working with all the right add-ons activated. For example, I'm using collective.blog.star, and at present, I have to log into the site and activate it to be able to add blog views, etc..

How can I make buildout also activate the add-ons it downloads in a particular Plone site object?

Iain Hallam
  • 289
  • 1
  • 13
  • I'm voting to close this as a dupe of your other question; the answer to this question is exactly the same as what I gave you in the other. – Martijn Pieters Feb 23 '13 at 14:50
  • Oh, right; fair enough, then. Do you happen to know if there's documentation of what Python I'd need to be looking at for activating and deactivating add-ons? My Google-fu is letting me down on this. – Iain Hallam Feb 23 '13 at 17:17
  • Usually, it's the quickinstaller that takes care of this for you. The recipe I gave you in my answer can run these for you. – Martijn Pieters Feb 23 '13 at 17:17

1 Answers1

1

As Martijn also writes, the quickinstaller takes care of this and it's merely a simple declaration of a dependency you can do in your package, to have the product installed on site-creation automagically, which takes two simple steps:

In the your.package/setup.py add:

setup( ...
    install_requires=[ ...
        'collective.blog.star'

To let buildout know, this egg shall be pulled and be provided to the ZOPE-instance, too.

And in your.package/your/package/profiles/default/metadata.xml add:

<object ... >
    <dependencies>
        <dependency>profile:collective.blog.star:default<dependency>        
    <dependencies>

To actually activate the dependency-product, when you install your product, via profiles.

Check if the profile's name is really 'default' as this is just a convention, defined in the configure.zcml of the product.

It might be, that the order of install can be crucial, as you also want to create content in the same process, I don't know by heart which step would be executed first, the c.b.star-install or the content-creation, you have to test this. In case, the order isn't right, you'd probably have to write another package for splitting the two tasks, controlling the order of install according to the position in the eggs-definitions-list (first comes first, IIRC).

Ida
  • 3,994
  • 21
  • 40