You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by James Riordon <ho...@outofcontrol.ca> on 2006/09/27 16:26:27 UTC
Trouble with automating svn update
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
Re: Trouble with automating svn update
Posted by James <ho...@outofcontrol.ca>.
I have made a little bit of progress but still in a corner. Here is
the error message that I get from logging the update-admin below:
Authentication realm: <http://site50:80> Subversion repository
Password for 'apache': Authentication realm: <http://site50:80>
Subversion repository
Username: svn: PROPFIND request failed on '/svn/site50_repo/trunk'
svn: PROPFIND of '/svn/site50_repo/trunk': authorization failed
(http://site50)
So obviously I have a permissions problem, but using the post-commit,
why am I being asked for a password at all? I know I am missing
something here, so any help would be appreciated. Thanks!
My current post-commit script looks like this:
#!/bin/sh
LOG=/home/virtual/site50/fst/home/svn/repos/site50_repo/hooks/post-
commit.log
/home/virtual/site50/fst/home/svn/repos/site50_repo/hooks/update-
admin 2>$LOG 1>$LOG
My repos are owned by apache:apache and all files in the dev site are
owned by apache:apache.
James
On Sep 27, 2006, at 12:26 PM, James wrote:
> 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
>
>