Reputation: 5582
I tried to do a post-commit to update my website at each commit. in the /hooks/post-commit
I did as follow
/svnUupdat/cProgrammeThatUpdate >> /log/test.log
Ok now if I try that
env - ./post-commit
it works, the website get update to the last revision (and there is something in the log)
but if I commit the post-commit is not called ?? (nothing in the log and the site is not updated)
Note that if I only put in the post-commit
/bin/echo "post-commit run" >> /log/test.log
If a commit something... it works.. there is something in the log.. Why is not calling my c programme then ?
EDIT I tried something else, that instead of calling a c programm
/usr/bin/svn update /var/www/vhost/xx.com/site1/ >> /var/log/svn/example.log
in the log I have Skipped /var/www...
Why is it skipped ? if i launch the svn update in a terminal it works the working directory get the last revision
thanks
Upvotes: 0
Views: 886
Reputation: 8437
BEWARE that when SVN calls the hook file, it does so as if no environment variables are set. You will therefore have to manually set the PATH variable at the beginning of your hook file.
Upvotes: 2
Reputation: 4944
The 'skipped' message indicates that Subversion cannot update the directory because it's not a working copy. However, this conflicts with your statement that you could update the directory manually. Maybe there's a typo somewhere in your path?
You should also be aware that the post-commit script is executed as the user who is committing. This may or may not be the same user that you are when using the terminal. You should check if the commit user has proper priviledges to execute the post-commit script and if that user has permissions to do whatever your script does.
Upvotes: 1