Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I publish a subversion repository to a local IIS?

At work, we have a windows server 2003 with IIS and Subversion installed. We use it to publish and test locally our ASP.NET websites. Every programmer has Tortoise installed on his PC and can update/commit content to the server. Hosting the repositories is working fine. But the files kept in those repositories needs then to be copied to our local IIS (virtual directories).

What is an easy way to publish those subversion repositories to our local IIS?

Edit:
Thanks to puetzk I added a simple bat file that gets executed every time a commit occurs (check the subversion documentation about hooks). My bat file only contains:

echo off
setlocal

:: Localize the working copy where IIS points)
pushd E:\wwwroot\yourapp\trunk
:: Update your working copy
svn update

endlocal
exit
like image 509
jdecuyper Avatar asked Sep 22 '08 23:09

jdecuyper


4 Answers

  1. Just keep the web server's file area as a working copy, and perform an svn up in it whenever you want to "publish". Configure it to hide the contents of the .svn folders if they seem untidy to you (I don't specifically know how to do this, but I assume it can be done). They will already have the filesystem hidden bit, which may take care of this.

  2. If you want it really automatic (updates as soon as someone commits), use a post-commit hook script on the SVN server to kick off the first process.

Others in the comments have suggested using export instead of checkout. That can work too, and avoids the .svn clutter, but has two drawbacks. One, it has to redownload the entire contents every time, not just the modified files (since it didn't keep the .svn dir to remember what it has). If you have a lot of files, this will be much slower. Two, update replaces the file atomically (writes the new version in .svn/tmp, then moves it into place). Export writes the file gradually into it's destination as it downloads. That means export could deliver an incomplete file to someone who browsed it at just the wrong time.

like image 99
puetzk Avatar answered Oct 10 '22 22:10

puetzk


SVN doesn't support IIS; you can however run the standalone svnserve server as a windows service.

There's the SVN FAQ entry about it, and this blog post on Vertigo Software blog may be helpful too.

UPDATE: After your clarification, I see that what you are looking for is a way to automatically update the code on the server after it's checked in. Look into CruiseControl.NET, after looking at the subversion integration tutorial it looks like it should do what you want.

UPDATE 2: This tutorial describes integrating Subversion, CruiseControl.NET and Nant.

like image 30
Aeon Avatar answered Oct 10 '22 21:10

Aeon


maybe SVNIsapi can solve the problem (http://www.svnisapi.com). Cause it only utilizes an IIS installation, therefore you don't need an APACHE server or an SVNSERVER service. Secondly it should be possible to stack the ASP.NET ISAPI plugin onto the processing of SVNISAPI, so that a ASP.NET (.aspx) page will interpreted after read from the repository.

Cheers Paolo

like image 28
user231161 Avatar answered Oct 10 '22 23:10

user231161


Use can use the free Visual-SVN Server to quickly install Subversion with Apache front end. It also have a nice MMC snap-in for managing the server and repositories.

You will than be able to access subversion with HTTP or HTTPS, but the port number must be different from the one your local IIS uses (default port for Visual-SVN server is 8080).

If you really need to access the repositories using your local IIS port 80, you can try SVN-IIS which acts as a bridge between your IIS and Apache. I haven't tried this one myself though.

like image 40
zvikara Avatar answered Oct 10 '22 21:10

zvikara