Aliaspooryorik
ColdFusion ORM Book

Subversion Hooks on Windows

We've recently upgraded our internal development server to Windows 2003. I've set up subversion server along with IIS, ColdFusion and SQL Server on it. I wanted to set up subversion so that when a developer commits a file, it will be automatically copied into the IIS webroot so that the local development server always has the latest version running on it (for client previews etc).

This can be done by using the post-commit hook. On Windows you will need to rename the post-commit.tmpl file to post-commit.bat which is in the hooks directory in your repository.

Here is my post-commit.bat file:

REM -----------------------------------------------------------------
REM - can use svn update or commit (which will create the working copy as well)
REM - or export (which is slow as all files are exported)
REM -----------------------------------------------------------------

"C:\svnserverpath\bin\svn.exe" update http://192.168.1.3:8080/svn/aliaspooryorik/trunk/ D:\webroot\aliaspooryorik --username myuser --password mypassword

To get this working you will need to checkout the repository to D:\webroot\aliaspooryorik first and also set up a user (only needs to be read only) to login as.

Hope this saves some head scratching!


2 comments

  1. If you have svn server is seperate from your cf server, you can use CURL and place a cfml file on your cfm server that gets called from the hook. I did this when we had multiple development servers to keep them updated.

    see for the basic idea - tinyurl.com/5qkffq

    Comment by Mike – November 19, 2008
  2. Hi Mike,
    Thanks for the comment and link. I'd missed that Jedi Master post!
    That is definately worth exploring as it opens up a lot of possibilities. Equally it also introduces a lot of opportunity for things to break as the process would be subversion -> batch file -> CUrl -> ColdFusion -> cfexecute back to subversion!

    Comment by John Whish – November 20, 2008

Leave a comment

If you found this post useful, interesting or just plain wrong, let me know - I like feedback :)

Please note: If you haven't commented before, then your comments will be moderated before they are displayed.

Please subscribe me to any further comments
 

Search

Wish List

Found something helpful & want to say ’thanks‘? Then visit my Amazon Wish List :)

Categories

Recent Posts