[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: Updating a live website with a post-commit hook script

From: Duane Griffin <d.griffin_at_psenterprise.com>
Date: 2006-06-30 13:33:49 CEST

Hi Graham,

On Wed, 2006-06-28 at 17:58 -0700, Graham Anderson wrote:
> 1) Is there an example script and tutorial on how to update a live
> web site with a post-commit hook script ?

IMO, and as others have mentioned, the best way of doing things is to
use "svn up" on the web-server to prepare a staging area, then switch
over to it atomically by changing a symlink. If for some reason you want
to use a different mechanism (e.g. you don't have subversion on your
web-server) you can use a post-commit hook to prepare a staging area
with the changes and then upload them using rsync or something similar.

Some time ago I was playing around with this sort of thing and posted a
script we were using to the list. It uploads files using scp and should
be easy to adapt, at least if you know perl. All the meta-data it uses
(destination to upload to, etc) it takes from subversion properties.
This allows you to use one repository and post-commit hook to manage
several different sites.

You can find the script here:
http://svn.haxx.se/users/archive-2005-04/att-1537/commit-upload.pl

I no longer use it myself, but if you have any questions I'll try my
best to answer them.

> 2) Does this comply with a 'best practices' use for subversion ? At
> this point, I am a bit too green to evaluate if this is ok.
>
> I am very new to subversion so any help is appreciated.

Regards,
Duane.

-- 
Duane Griffin
Senior Software Developer
Process Systems Enterprise Limited - "The model company"
Bridge Studios, 107a Hammersmith Bridge Road, London W6 9DA
Call +44 (0)20 8563 0888 or visit us at www.psenterprise.com
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Fri Jun 30 13:35:07 2006

This is an archived mail posted to the Subversion Users mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.