SubVersion update on commit


Alright, I’ve read many other forums touching on this, but none pertaining directly to dreamhost and none with a solution that worked for me.

I want to use subversion to administer website development, but I want to set it up so that every time a developer commits, it updates the files on a development web server. This is to be done with post-commit, which is run after a user uploads changes.

Here is what I have in post-commit:


/usr/bin/svn update /home//

When I created the svn working copy with svn checkout file:///home//svn// /home//

My problem is that because the scripts are run as the “dhapache” user, it won’t update my working copy. Suggestions? Any help is greatly appreciated


Ok, I figured out a way to make it work. Since CGI scripts are run as the user who created them, you can set one up to run the svn update for you. Here’s what I did:

  1. Created a script in a secured folder, in my dev site.


disable filename globbing

set -f
echo Content-type: text/plain
echo “—++New Commit/Update+±–”
/usr/bin/svn update /home/.onion/icetek/

then I setup my post-commit file like this:



wget -O - --http-user=RANDOM_STRING --http-passwd=RANDOM_STRING >> /home/______/status/post-commit-log.txt

This way, I get a log of every update made to the dev site. I will probably be using this for more then just this site, so I will probably make the cgi script more complex, and be able to update different sites, we’ll see. This works for now.


Yup - works for me. At long last - i tried following directions on dreamhost wiki for post-commits and gave up trying to get it to work after 2 days. This one worked for me immediately. There is however a 40 second ‘hang’ at end of each commit - be nice to get rid of that.