How can I publish a subversion repository to a loc

2019-02-03 15:14发布

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

4条回答
别忘想泡老子
2楼-- · 2019-02-03 15:24
  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.

查看更多
一纸荒年 Trace。
3楼-- · 2019-02-03 15:29

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

查看更多
ら.Afraid
4楼-- · 2019-02-03 15:36

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.

查看更多
Root(大扎)
5楼-- · 2019-02-03 15:43

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.

查看更多
登录 后发表回答