使用 2 个 SVN 存储库进行网站 - 发布问题
我对此完全是个菜鸟,所以如果有一个完全明显的答案,请务必取笑、指指点点并大笑,然后给出答案。
我们使用 Visual Studio 2010 来编译我们发布的网站。我有一个用于源代码的存储库,以及一个将编译后的代码发布到的存储库。然后,我检查测试服务器上的发布存储库,一旦测试良好,我就会检查主服务器上的存储库。这很好,但我正在使用 Tortoise SVN 并自动提交。问题是,我确实需要擦除发布 SVN 存储库,然后复制文件,然后提交。我只是无法让它发生并且让它仍然将其识别为 SVN 存储库。建议?
I am a complete noob to this so if there is a completely obvious answer by all means make fun and point and laugh then give the answer.
We use Visual Studio 2010 to compile our published website. I have a repository that I use for my source code and one which I publish the compiled code to. I then check out the publish repository on the testing server and once it tests good I check out the repository on my main server. This is fine and all but I am using Tortoise SVN and automating the commit. Problem is, I really need to wipe the publish SVN repository, then copy the files, then commit. I just can't get that to happen and have it still recognize it as a SVN repository. Suggestions?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
首先,不要将编译后的代码放入源存储库中。这是糟糕的形式。
将 Jenkins 视为构建服务器。 Jenkins 可以使用
msbuild.exe
命令使用项目创建的.sln
文件来构建 .NET 项目。当您在 Subversion 中进行提交时,Jenkins 将自动启动构建。如果您有 NUnit 测试,Jenkins 将运行这些测试并给出结果。您可以让 Jenkins 将编译后的文件存储在其存档中。如果有人想要安装特定的版本,他们可以直接从 Jenkins 下载它,而无需先在 Subversion 中进行签出。
Jenkins 提供了所有这些优点:
Jenkins 易于使用和安装。下载并尝试一下。
First of all, don't put compiled code into your source repository. It's bad form.
Look at Jenkins as a build server. Jenkins can use the
msbuild.exe
command to build .NET projects using the.sln
file your project creates.When you do a commit in Subversion, Jenkins will automatically fire off the build. If you have NUnit tests, Jenkins will run those and give you the results. You can have Jenkins store the compiled files for you in its archive. If someone wants to install a particular build, they can directly download it from Jenkins without having to do a checkout in Subversion first.
Jenkins offer all of these advantages:
Jenkins is easy to use and install. Download it and give it a try.
除非您有严格要求,迫使您使用两个单独的存储库,否则我建议您看看 SVN 标记和分支功能。
http://tortoisesvn.net/docs/release/TortoiseSVN_en/tsvn-dug -branchtag.html
Unless you have a hard and fast requirement which forces you to use two separate repositories, i'd suggest taking a look at SVN tagging and branching functionality.
http://tortoisesvn.net/docs/release/TortoiseSVN_en/tsvn-dug-branchtag.html
拥有已发布代码的存储库确实不会给您带来任何好处。 IMO,您最好使用一堆 zip 文件(每个版本一个),并在名称中反映日期和 SVN 分支。 zip 中有一个变更日志 .txt 文件,并将其签入存储库。
Having a repository for the published code really doesn't buy you anything. IMO, you would be better off with a bunch of zip files (one per release) with the date and SVN branch reflected in the name. DO have a changelog .txt file in the zip, and also check that into the repo.
您不需要需要在存储库中进行擦除。只需使用从 dev-repo (提交消息的提交后挂钩)导出的 HEAD 提交到生产存储库,
是的,标签是更自然、更防弹的方式。
You don't need wiping in repo. Just make commit to production repo with exported HEAD from dev-repo (post-commit hook for commit message)
And tags, yes, are more natural and bulletproof way.