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

Re: post-commit hook script to update a live website

From: Bob Proulx <bob_at_proulx.com>
Date: 2006-12-04 06:28:58 CET

Thanos wrote:
> I have placed a very simple post-commit script I have found on another
> thread on this mailing-list with the following content in
> repositorypath/hooks:
> #!/bin/sh
> cd /var/www/svn || exit 1
> svn update --quiet
> exit 0

That looks perfect to me. Once you find the problem you should
definitely return to this simple script.

Note that PATH is unset by subversion. I consider that a design
flaw. The svn developers consider it security to push this problem
upon the hook script. Since I use bash and bash will detect an unset
PATH and automatically set an appropriate one then this is not a
problem for me but others with other shells have reported problems.

> The script has correct owner/permissions (755, apache:apache), however
> it doesn't work. After each commit /var/www/svn is still empty.
> Can you help me in fixing this issue ?

Turn the script into this so that after it is run you can see the
errors and debug the output.

  exec >/tmp/svn-up.out 2>&1
  cd /var/www/svn || exit 1
  ls -ld
  touch foo && rm -f foo # just to test writability to the directory
  svn update
  exit 0

Trigger the script and then look in /tmp/svn-up.out for errors and
debugging output.


To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Mon Dec 4 06:28:32 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.