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

Trouble with automating svn update

From: James Riordon <hosting_at_outofcontrol.ca>
Date: 2006-09-27 18:26:27 CEST

Hello,

        This is my first post to the list. I have been using subversion for
a little over a year now but have just learnt about the hooks
recently. I have post-commit working currently very well with the
commit-email.pl script, and the pre-commit working in as far that it
refuses empty commit messages with a friendly error.

        Today I need to setup another post-commit hook to automate the
updating of our dev server each time a commit is done to the repo.
Here are the particulars of my setup:

Repo:
/home/virtual/site1/fst/home/svn/repos/site50_repo

Dev site:
/home/virtual/site50/fst/var/www

Two versions of post-commit script have been tried:
Version 1:
#!/bin/sh
/usr/bin/svn update /home/virtual/site50/fst/var/www
...
rest of post-commit (which works fine)

Version 2:
#!/bin/sh
/use/local/bin/update-admin
...
rest of post-commit (which works fine)

update-admin is a small C binary that contains this:
#include <stdlib.h>
int main(int argc, const char *argv[])
        {
                system("/usr/bin/svn update /home/virtual/site50/fst/var/www/");
        }
update-admin is chown'd to admin50:admin50 and chmod 755 +s, as per
the instructions at:
http://arstechnica.com/articles/columns/linux/linux-20050406.ars

Both version of post-commit run perfectly from the command line, so I
know I am mostly there. But for the life of me, trying different
permissions, I can't seem to get it to work when I do a commit to the
repos. There are no errors and the rest of the post-commit executes
perfectly, which simply emails me the commit.

Being fairly new with hooks, I have been busily reading everything I
can find, the beans book, mailing lists, but nothing seems to help me
to get this to work. I think it is just an obvious oversight on my
part, but I can't see. Does anyone have any suggestions? Thanks!

James
Received on Wed Sep 27 18:27:26 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.