Subversion post-commit hook will not run on commit, script works because I can run it on the command line

StackOverflow https://stackoverflow.com//questions/20040218

Question

I have just made a new repository. My server is Ubuntu 12.04 32 bit. I want my commits to be live as soon as I have committed them. This is achieved by making a working copy in my public html directory, and having the post-commit hook update that working copy. I have set that up using the instructions here:

http://www.frenssen.be/content/using-subversion-automatically-update-live-website

The issue is that my post-commit will not run when my project commits. My project commits just fine. I know that the script is a valid script too, because I can run it with

env ./post-commit

inside of the hooks directory and it properly updates.

I thought it might be a permissions thing so I have made extensive use of chown to ensure that www-data is the owner of:

the repo /home/svn/repo2
the working copy /var/www/html
the hook /home/svn/repo2/hooks/post-commit
the update binary /home/svn/autoupdate/autoupdate

But still nothing. My commits are successful, but the hook never runs. My hook script looks like this:

#!/bin/sh
/home/svn/autoupdate/autoupdate

All of the googling seems to be pointing to a permissions issue but I can't figure this one out.

Was it helpful?

Solution

Can you repeat this guy's example, and see if it works at all?
mikewest.org/2006/06/subversion-post-commit-hooks-101

Do you get an error when you commit?

If your post-commit hook actually failed, I think you would see evidence of that in whatever client you were using to perform the checkin. I'm almost suspecting that post-commit is not firing at all. Just to double check, the file needs to actually be called post-commit, all lowercase, and not post-commit.tmpl.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top