I have looked at many many articles online but none have seemed to yield an answer. I run a setup where:
I have a website that will run a copy of trunk files This website has an svn folder associated with it I have a local testing environment of wampserver/mamp on my mac, tortoise svn on my pc
So i have a checkout of the repository, i make my changes and when I have a release - I commit the files.
I would like an automatic update on commit to the svn repository - this wiki explains how to do it: http://wiki.dreamhost.com/Subversion#Automatic_Post-commit_Checkout
unfortunately it is fraught with problems. Once i had my cgi folders and my updated post-commit hook sortedm i was recieving the exit code of 255. After i converted the cgi and the hook to unix and re-uploaded i had an exit code of 1.
I changed the chmod again, and no i recieve no errors. And unfortunately dreamhost does not update the files into my live site.
My hook file looks like this:
post commit:
#!/bin/bash
wget --http-user=username --http-passwd=password -qO - http://website.com/cgi-bin/pri/do_update.cgi
and my do_update.cgi: #!/bin/sh
# disable filename globbing
set -f
echo "Content-type: text/plain; charset=iso-8859-1"
echo
echo /usr/bin/svn update /home/username/website.com
Google returns many many pages with this problem, and unless i suddenly learn how to compile a program in C, i wont be able to make this work.
Any help appreciated, and would finally put a good answer out on the internet for everyone else...
Here is what I do, it isn't on a linux machine, but it seems to work for me to just call svn directly on the post-commit. If you have a large export it does delay your checkin a little bit, but is super simple. Should be very similar for linux machines.
The hook: