Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Zope: Dev

Handling instance specific configuration files with buildout

 

 

Zope dev RSS feed   Index | Next | Previous | View Threaded


charlie.clark at clark-consulting

Nov 18, 2009, 4:29 AM

Post #1 of 7 (988 views)
Permalink
Handling instance specific configuration files with buildout

Hi,

thanks to Hanno's help I'm up and running with buildout. Having spent the
last couple of years tied to to some frozen Zope and CMF checkouts it's
quite refreshing to be able to try newer components with our own. :-)

There is, however, one thing I haven't quite worked out how to do is add
stuff to the instance's "etc" folder. We have some configuration files
which are instance specific which we have so far kept in in etc/config. Do
I need to create a recipe that does this for this part?

Charlie
--
Charlie Clark
Managing Director
Clark Consulting & Research
German Office
Helmholtzstr. 20
Düsseldorf
D- 40215
Tel: +49-211-600-3657
Mobile: +49-178-782-6226
_______________________________________________
Zope-Dev maillist - Zope-Dev [at] zope
https://mail.zope.org/mailman/listinfo/zope-dev
** No cross posts or HTML encoding! **
(Related lists -
https://mail.zope.org/mailman/listinfo/zope-announce
https://mail.zope.org/mailman/listinfo/zope )


chris at simplistix

Nov 18, 2009, 5:19 AM

Post #2 of 7 (937 views)
Permalink
Re: Handling instance specific configuration files with buildout [In reply to]

Charlie Clark wrote:
> There is, however, one thing I haven't quite worked out how to do is add
> stuff to the instance's "etc" folder. We have some configuration files
> which are instance specific which we have so far kept in in etc/config. Do
> I need to create a recipe that does this for this part?

You have a few options:

1 - just leave them as they are :-)

2 - use collective.recipe.template or topp.recipes.cfgtemplate if you
need to replace bits of the stuff in etc with stuff from the buildout
(such as the buildout directory)

3 - go the "deployment" route using zc.recipe.deployment where all
config ends up in buildout.cfg. For this, you do need a recipe for each
cfg file or group thereof. There are currently recipes for zeo servers
and zeoraid servers, I'll be doing one for Zope 2.12 "some time soon",
which should suffice for Plone too...

cheers,

Chris

--
Simplistix - Content Management, Batch Processing & Python Consulting
- http://www.simplistix.co.uk
_______________________________________________
Zope-Dev maillist - Zope-Dev [at] zope
https://mail.zope.org/mailman/listinfo/zope-dev
** No cross posts or HTML encoding! **
(Related lists -
https://mail.zope.org/mailman/listinfo/zope-announce
https://mail.zope.org/mailman/listinfo/zope )


charlie.clark at clark-consulting

Nov 18, 2009, 5:28 AM

Post #3 of 7 (923 views)
Permalink
Re: Handling instance specific configuration files with buildout [In reply to]

Am 18.11.2009, 14:19 Uhr, schrieb Chris Withers <chris [at] simplistix>:

Hi Chris,

> You have a few options:
> 1 - just leave them as they are

I just need to link/copy from something parts/instance/etc/config to say
src/config or downloads/config

2 - use collective.recipe.template or
> topp.recipes.cfgtemplate if you need to replace bits of the stuff in etc
> with stuff from the buildout (such as the buildout directory)

I'll have a look at them as this might be the easiest.

> 3 - go the "deployment" route using zc.recipe.deployment where all
> config ends up in buildout.cfg. For this, you do need a recipe for each
> cfg file or group thereof.

hm, sort of makes sense configuring them in buildout but I still need them
in parts/instance/etc/config. I guess I'll need to look at those, too.

> There are currently recipes for zeo servers and zeoraid servers, I'll be
> doing one for Zope 2.12 "some time soon", which should suffice for Plone
> too...

And presumably CMF!

Thanks

Charlie
--
Charlie Clark
Managing Director
Clark Consulting & Research
German Office
Helmholtzstr. 20
Düsseldorf
D- 40215
Tel: +49-211-600-3657
Mobile: +49-178-782-6226
_______________________________________________
Zope-Dev maillist - Zope-Dev [at] zope
https://mail.zope.org/mailman/listinfo/zope-dev
** No cross posts or HTML encoding! **
(Related lists -
https://mail.zope.org/mailman/listinfo/zope-announce
https://mail.zope.org/mailman/listinfo/zope )


chris at simplistix

Nov 18, 2009, 5:42 AM

Post #4 of 7 (921 views)
Permalink
Re: Handling instance specific configuration files with buildout [In reply to]

Charlie Clark wrote:
>> You have a few options:
>> 1 - just leave them as they are
>
> I just need to link/copy from something parts/instance/etc/config to say
> src/config or downloads/config

I don't understand what you're trying to say :-S

>> 3 - go the "deployment" route using zc.recipe.deployment where all
>> config ends up in buildout.cfg. For this, you do need a recipe for each
>> cfg file or group thereof.
>
> hm, sort of makes sense configuring them in buildout but I still need them
> in parts/instance/etc/config.

Beware of keeping anything that can't be rebuilt from scratch by running
bin/buildout in ./parts, buildout has a habit of blowing away that whole
folder at will...

>> There are currently recipes for zeo servers and zeoraid servers, I'll be
>> doing one for Zope 2.12 "some time soon", which should suffice for Plone
>> too...
>
> And presumably CMF!

Indeed, provided you're on 2.12...

Chris

--
Simplistix - Content Management, Batch Processing & Python Consulting
- http://www.simplistix.co.uk
_______________________________________________
Zope-Dev maillist - Zope-Dev [at] zope
https://mail.zope.org/mailman/listinfo/zope-dev
** No cross posts or HTML encoding! **
(Related lists -
https://mail.zope.org/mailman/listinfo/zope-announce
https://mail.zope.org/mailman/listinfo/zope )


hanno at hannosch

Nov 18, 2009, 5:48 AM

Post #5 of 7 (928 views)
Permalink
Re: Handling instance specific configuration files with buildout [In reply to]

On Wed, Nov 18, 2009 at 1:29 PM, Charlie Clark
<charlie.clark [at] clark-consulting> wrote:
> There is, however, one thing I haven't quite worked out how to do is add
> stuff to the instance's "etc" folder. We have some configuration files
> which are instance specific which we have so far kept in in etc/config. Do
> I need to create a recipe that does this for this part?

We use this snippet for something similar:

[link-extensions]
recipe = plone.recipe.command
command =
for i in ${buildout:parts-directory}/instance*; do rm -rf
$i/Extensions; ln -s ${buildout:directory}/Extensions $i/Extensions;
done
update-command = ${link-extensions:command}


I'm sure you can adopt this to linking everything in
${buildout:directory}/config into the various parts/instance*
directories.

Hanno
_______________________________________________
Zope-Dev maillist - Zope-Dev [at] zope
https://mail.zope.org/mailman/listinfo/zope-dev
** No cross posts or HTML encoding! **
(Related lists -
https://mail.zope.org/mailman/listinfo/zope-announce
https://mail.zope.org/mailman/listinfo/zope )


charlie.clark at clark-consulting

Nov 18, 2009, 5:50 AM

Post #6 of 7 (931 views)
Permalink
Re: Handling instance specific configuration files with buildout [In reply to]

Am 18.11.2009, 14:42 Uhr, schrieb Chris Withers <chris [at] simplistix>:

> I don't understand what you're trying to say :-S

hehe. Stuff needs to go in the instance's etc folder from somewhere else
in the project.

> 3 - go the "deployment" route using zc.recipe.deployment where all
> config ends up in buildout.cfg. For this, you do need a recipe for each
> cfg file or group thereof.
> hm, sort of makes sense configuring them in buildout but I still need
> them in parts/instance/etc/config.

> Beware of keeping anything that can't be rebuilt from scratch by running
> bin/buildout in ./parts, buildout has a habit of blowing away that whole
> folder at will...

Everything is in our repository so that shouldn't be a problem.

> There are currently recipes for zeo servers and zeoraid servers, I'll
> be doing one for Zope 2.12 "some time soon", which should suffice for
> Plone too...
> And presumably CMF!
> Indeed, provided you're on 2.12...

Indeed I am!

Charlie
--
Charlie Clark
Managing Director
Clark Consulting & Research
German Office
Helmholtzstr. 20
Düsseldorf
D- 40215
Tel: +49-211-600-3657
Mobile: +49-178-782-6226
_______________________________________________
Zope-Dev maillist - Zope-Dev [at] zope
https://mail.zope.org/mailman/listinfo/zope-dev
** No cross posts or HTML encoding! **
(Related lists -
https://mail.zope.org/mailman/listinfo/zope-announce
https://mail.zope.org/mailman/listinfo/zope )


charlie.clark at clark-consulting

Nov 18, 2009, 6:19 AM

Post #7 of 7 (917 views)
Permalink
Re: Handling instance specific configuration files with buildout [In reply to]

Am 18.11.2009, 14:48 Uhr, schrieb Hanno Schlichting <hanno [at] hannosch>:

> We use this snippet for something similar:
> [link-extensions]
> recipe = plone.recipe.command
> command =
> for i in ${buildout:parts-directory}/instance*; do rm -rf
> $i/Extensions; ln -s ${buildout:directory}/Extensions $i/Extensions;
> done
> update-command = ${link-extensions:command}
> I'm sure you can adopt this to linking everything in
> ${buildout:directory}/config into the various parts/instance*
> directories.

Hi Hanno,

that does indeed look pretty usable.

[camaoCms.cfg]
recipe = plone.recipe.command
command =
rm -rf ${buildout:parts-directory}/instance/etc/cfg;
cp -R ./src/camaoCms.cfg ${buildout:parts-directory}/instance/etc/cfg;

Works fine even thought I'm sure it can be improved.

Charlie
--
Charlie Clark
Managing Director
Clark Consulting & Research
German Office
Helmholtzstr. 20
Düsseldorf
D- 40215
Tel: +49-211-600-3657
Mobile: +49-178-782-6226
_______________________________________________
Zope-Dev maillist - Zope-Dev [at] zope
https://mail.zope.org/mailman/listinfo/zope-dev
** No cross posts or HTML encoding! **
(Related lists -
https://mail.zope.org/mailman/listinfo/zope-announce
https://mail.zope.org/mailman/listinfo/zope )

Zope dev RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.