Hook post-commit not launch

kheled
kheled
Hello,  I Work on a web project. And I want to update my www after any commit.  I use post-commit script but it is never launch.    here is my post-commit script.    # cat post-commit    #!/bin/sh  /usr/local/bin/svn update /raid/www/project      svnserver is launch by root like my script and I made chmod 777 on my repository.    I dont understand how to launch my script and i try a lot of thing.    Thanks you and sorry for my bad english.

Last updated

JNiven
JNiven
Hi kheled    It all looks good to me - you've got the full path to the svn executable in the script, permissions for the script look OK (too permissive, but that's fine for debugging, and the execute bit is set). The only things I can think of are:    Can you run the script manually, i.e. what happens when *you* execute the script, instead of trying to get an SVN hook to execute it?  What's the name of the script? i.e. you've not forgotten to remove the ".tmpl" from its filename, have you? (Sorry, I have to ask - it's a mistake I've made and I'm sure I'm not the only one...)  Have you double-checked the SVN executable is really /usr/local/bin/svn ? Try "which svn" to make sure.    Most of these seem really silly things to suggest - please don't be offended - but they may, particularly the 1st suggestion, give us more information.    Cheers  John
kheled
kheled
Hello JNiven,    I forgot to write that, but yes the script works well when I launch it myself  The name is "post-commit", but i tried with "post-commit.tmpl" and it doesn't work.  It's the good path to the svn binary though.    I tried to write another script, named "post" whith the same shell command, and call it in the "post-commit" script. I tried with "./post" or just "post" but it never work    Thanks
ScottDF
ScottDF
Did you rename and move the hook script to the /hooks directory as described in the Manual?
mike5
mike5
Did you chmod a+x post-commit?    Br, Mike5
kheled
kheled
Yes my script is in /raid/svn/project/hooks/ and I do a    chmod -R 777 /raid/svn/project    so my "post-commit" script have all the permissions.
kheled
kheled
I post more details.    # pwd  /raid/svn/project/hooks  # ll  total 26  -rwxrwxrwx 1 root wheel 58 Apr 15 18:00 post-commit  -rwxrwxrwx 1 root wheel 1638 Apr 14 12:26 post-lock.tmpl  -rwxrwxrwx 1 root wheel 2255 Apr 14 12:26 post-revprop-change.tmpl  -rwxrwxrwx 1 root wheel 1567 Apr 14 12:26 post-unlock.tmpl  -rwxrwxrwx 1 root wheel 2940 Apr 14 12:26 pre-commit.tmpl  -rwxrwxrwx 1 root wheel 2044 Apr 14 12:26 pre-lock.tmpl  -rwxrwxrwx 1 root wheel 2764 Apr 14 12:26 pre-revprop-change.tmpl  -rwxrwxrwx 1 root wheel 1985 Apr 14 12:26 pre-unlock.tmpl  -rwxrwxrwx 1 root wheel 2137 Apr 14 12:26 start-commit.tmpl  # cat post-commit  #!/bin/sh  sudo /usr/local/bin/svn update /raid/www/project  # ./post-commit  At revision 31.  #    I need your help on this.    Thanks    EDIT:  I tried with 2 more script, start-commit and pre-commit, the scripts juste create a file, but no one is launch with a commit.
ScottDF
ScottDF
Change the name of the script you wish to run from scriptname.tmpl to scriptname
mike5
mike5
Also, since there is no environment in the hook scripts, /bin/sh does not know where to look for sudo. Try using full path to it.    Br, Mike5

1-9 of 9

Reply to this discussion

You cannot edit posts or make replies: You should be logged in before you can post.