如何将 subversion 存储库发布到本地 IIS? [英] How can I publish a subversion repository to a local IIS?

查看:29
本文介绍了如何将 subversion 存储库发布到本地 IIS?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在工作中,我们有一个安装了 IIS 和 Subversion 的 windows server 2003.我们使用它在本地发布和测试我们的 ASP.NET 网站.每个程序员都在他的 PC 上安装了 Tortoise,并且可以更新/提交内容到服务器.托管存储库工作正常.但是保存在这些存储库中的文件需要复制到我们的本地 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).

将这些颠覆存储库发布到我们本地 IIS 的简单方法是什么?

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


感谢 puetzk 我添加了一个简单的 bat 文件,每次提交时都会执行(检查 颠覆文档 关于钩子).我的 bat 文件只包含:


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:wwwrootyourapp	runk
:: Update your working copy
svn update

endlocal
exit

推荐答案

  1. 只需将 Web 服务器的文件区域保存为工作副本,并在您想要发布"时在其中执行 svn up.配置它以隐藏 .svn 文件夹的内容,如果它们看起来不整洁(我不具体知道如何执行此操作,但我认为可以完成).他们已经拥有文件系统隐藏位,这可能会解决这个问题.

  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.

如果您希望它真正自动化(一旦有人提交就更新),请在 SVN 服务器上使用提交后挂钩脚本来启动第一个进程.

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.

评论中的其他人建议使用导出而不是结帐.这也可以工作,并避免 .svn 混乱,但有两个缺点.一,它每次都必须重新下载整个内容,而不仅仅是修改过的文件(因为它没有保留 .svn 目录来记住它有什么).如果你有很多文件,这会慢得多.第二,更新自动替换文件(将新版本写入 .svn/tmp,然后将其移动到位).导出将文件在下载时逐渐写入其目的地.这意味着导出可能会将不完整的文件传递给在错误时间浏览它的人.

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.

这篇关于如何将 subversion 存储库发布到本地 IIS?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆