且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何将 subversion 存储库发布到本地 IIS?

更新时间:2023-01-12 10:06:34

  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.