How can I publish a subversion repository to a local IIS?
Solution 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.
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.
Solution 2
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.
Solution 3
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
Solution 4
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.
jdecuyper
I have a Bachelor degree in Sociology and a master degree in Computer Science! I started programming with my Commodore 64 in the nineties and with VB6, ASP and ActionScript around 2002. Today, I mostly build web applications with ASP.NET, MSSQL and Javascript. Over the time, I have proven multiple times being able to adapt to any kind of technology or languages. I always strive to use programming pattern, write reusable code and simplify the user's experience. Cruise Control, SVN and Git occupy a privileged spot in my tool box.
Updated on July 29, 2022Comments
-
jdecuyper over 1 year
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
-
puetzk over 15 yearsUnless I misunderstand, @jdecuyper is looking for a way to publish the contents of his repository, not a way to host it.
-
JKueck over 15 yearsThat would work fine. I might take it one step further and create a NANT script to do that work for you, possibly doing a SVN export instead of a checkout.
-
JKueck over 15 yearsI'm a fan of storing the Nant scripts as part of the project. Check out dimecasts.net/Casts/ByTag/NAnt.
-
Aeon over 15 yearsAh, I think I misunderstood. In that case @puetzk's answer is absolutely right. You can also use a continuous integration toolkit for that; I'm adding that to my response.
-
jdecuyper over 15 yearsWe are actually using Visual-SVN Server (which is great by the way) and can access our files trough HTTP (port 8443). But aspx files are not served (only displayed in plain text) and we need them to be processed.
-
JKueck over 15 yearsGood points on the export. I've never used it that way in practice (I let Nant do all the dirty work), but thought it was worth mentioning. I'd add that export would also require you to clean out the existing files first, where as an update would do this work for you.
-
Simon D about 14 yearssvnforum.org/2017/… Paolo - this forum people say svnisapi.com lifted content from another SVN on windows site (sublimesvn.com). You might want to refute that comment and clarify your relationship with the company. Please note that I am not affiliated with either of these products, just researching possibilities for our own svn installation.