Peter Bengtsson

How I refresh production Zopes

By: Peter Bengtsson, 7th of August 2006

7th of August 2006

In June I blogged about How I refresh my Zope products and introduced you to my little ZopeProductRefreshing. What I didn't emphasize enough was that this is also brilliant for production Zopes. Restarting a development Zope is almost OK, restarting a live Zope is really bad and using the browser to visit the Control_Panel/YourProduct/ isn't very efficient either.

Here's how I do it...

First of all you need to install the scripts in the Zope root and when you configure your refresh_myproduct.py script the refresh_type should be set to forced like this:

 refresh_type = "forced"

because then it'll refresh the product even if the only changes are in template code which is required if the Zope is not in debug-mode. Next you write a little shell script that you put in your Zope root and make it executable. It might look like this:

 $ emacs updateMyProductLive.sh
 $ chmod +x updateMyProductLive.sh

The content of updateMyProductLive.sh might look like this:

 #!/bin/sh
 cd Products/MyProduct
 svn update
 cd ../..
 python refresh_myproduct.py once

This means that by one stroke of a command you can update the latest code from the source code repository and update the Zope product. (it might not work the first time since the mtimer.py script needs comparison base)

More can be said on the topic of buildouts or automated source code updates but that's not really the point here.

PS. This will only work in Zope 2.7 and Zope 2.8 In Zope 2.9 product refreshing is broken :(




Comment

 



hide my email address.

Your email address will be encoded to prevent email-extraction spiders from reading it so you won't get spammed if you decide to show your email address.