tags:

views:

100

answers:

3

Hi,

I m setting up SVN on my local web development server and I'm wanting to create a post-commit hook that exports the repo to the production server (either via FTP, SSH, etc) when the commit message contains the word "deploy" or something similar. I know this has to be a common function for SVN but I can't seem to find anything that does just this. Maybe another set of eyes will lead me to the correct solution...

Thanks in advance!

+2  A: 

One thing I have done (on projects specifically designed for this type of release) is to checkout the project into my production server, then do an svn update on it when the code is ready to be moved to production.

manyxcxi
Thanks, that makes the most sense to me.
Jesse Bunch
A: 

Check out the documentation on post-commit hooks, as well as some basic examples. A google search for "svn post-commit hook" pulls up lots of examples.

eykanal
+1  A: 

As others have suggested, I'm not a huge fan of this. I've written post-commit hooks that update third-party ticketing, etc. systems via their HTTP APIs, and I'm not thrilled at the time it takes to actually commit a revision that matches the criteria--I think I'd be less thrilled if I had to wait for it to upload actual binaries to another server, even if it were on the same subnet. We also currently check in our builds from the build server and just check them out on the deployment servers, which is easily automatable.

Marc Bollinger