Hi all,
I have successfully set up a subversion repository using the Virtualmin functionality and have checked out a working copy to my local system here.
Now, I want to to set up a post-commit hook to update my dev site every time a set of changes is committed by myself or one of my developers.
I cannot believe this is so difficult achieve, as without this, I fail to see the point of subversion;s existence at all.
I am committing changes through a subversion client (Versions on Mac OS X or SmartSVN on Windows). The problem is, whenever I attach a post-commit script, the commit throws an error:
Commit failed (details follow):
MERGE of '/svn/irbsandc.com/content': 200 OK (http://irbsandc.com)
I have tried running the post-commit hook in two ways: firstly, by running this:
/usr/bin/svn update /home/irbsandc.com/domains/dev.irbsandc.com/public_html >> /home/irbsandc.com/logs/subversion_log
And, suspecting that the problem may have something to do with the user performing the operation not having appropriate privileges, I compiled an executable binary as instructed here:
http://www.frenssen.be/content/using-subversion-automatically-update-live-website
and ran this:
/home/irbsandc.com/svn/autoupdate/autoupdate
where autoupdate is a compile of this
#include <stddef.h>
#include <stdlib.h>
#include <unistd.h>
int main(void)
{
execl("/usr/bin/svn", "svn", "update",
"/home/irbsandc.com/domains/dev.irbsandc.com/public_html/",
(const char *) NULL);
return(EXIT_FAILURE);
}
In both cases, running the same code from the command line when logged in as the user who owns the domain, runs fine with no errors at all and the dev site is immediately updated.
When I look in the error log for my irbsandc.com domain, I see this:
user apache not found: /svn/irbsandc.com
every time the commit is attempted.
One other thing I should add - the commit does in fact succeed, even though it throws the error, so the amended files do make it into the respository. But then I have to run an update before I can continue working, and then run the update manually… and I end up wishing I was still using good old FTP.
Any help would be sincerely appreciated.