使用 2 个 SVN 存储库进行网站 - 发布问题

发布于 2024-12-03 12:40:06 字数 267 浏览 1 评论 0原文

我对此完全是个菜鸟,所以如果有一个完全明显的答案,请务必取笑、指指点点并大笑,然后给出答案。

我们使用 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

仙女山的月亮 2024-12-10 12:40:06

首先,不要将编译后的代码放入源存储库中。这是糟糕的形式。

Jenkins 视为构建服务器。 Jenkins 可以使用 msbuild.exe 命令使用项目创建的 .sln 文件来构建 .NET 项目。

当您在 Subversion 中进行提交时,Jenkins 将自动启动构建。如果您有 NUnit 测试,Jenkins 将运行这些测试并给出结果。您可以让 Jenkins 将编译后的文件存储在其存档中。如果有人想要安装特定的版本,他们可以直接从 Jenkins 下载它,而无需先在 Subversion 中进行签出。

Jenkins 提供了所有这些优点:

  • 它向您显示存储库中的所有更改以及每次提交中更改的内容。
  • 它可以自动为您运行各种测试。
  • 您可以使用“简单促销”插件标记已发布的版本。
  • 您可以直接在 Jenkins 中标记 Subversion 中的构建,无需命令行或工作目录。
  • 如果由于代码错误而导致构建失败或测试失败,它可以向开发人员发出警报。这些警报可以通过电子邮件、即时消息、电话短信、Twitter 和许多其他方式完成。所需要的只是 Jenkins 使安装变得容易的正确插件。
  • Jenkins 可以充当发布存储库,使您可以轻松查找版本、版本中的内容以及原因。
  • Jenkins 与 Bamboo、ViewVC 和 Sventon 集成。这些是基于 Web 的存储库浏览器。这样,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:

  • It shows you all the changes in your repository and what changed in each commit.
  • It can run all sorts of tests automatically for you.
  • You can mark builds that are released using the "Simple Promotion" plugin.
  • You can tag builds in Subversion directly in Jenkins without needing a command line or working directory.
  • It can alert the developers if a build fails due to bad code, or if testing fails. These alerts can be done via Email, instant messaging, phone text messages, Twitter, and many other ways. All it takes is the right plugin which Jenkins makes easy to install.
  • Jenkins can act as a release repository which makes it easy to find the release, what's in the release and why.
  • Jenkins integrates with Bamboo, ViewVC, and Sventon. These are web-based repository browsers. This way Jenkins not only shows you the file changed, but what changed in the file.

Jenkins is easy to use and install. Download it and give it a try.

鹊巢 2024-12-10 12:40:06

除非您有严格要求,迫使您使用两个单独的存储库,否则我建议您看看 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

看海 2024-12-10 12:40:06

拥有已发布代码的存储库确实不会给您带来任何好处。 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.

司马昭之心 2024-12-10 12:40:06

问题是,我确实需要擦除发布 SVN 存储库,然后复制文件,然后提交。

不需要需要在存储库中进行擦除。只需使用从 dev-repo (提交消息的提交后挂钩)导出的 HEAD 提交到生产存储库,

是的,标签是更自然、更防弹的方式。

Problem is, I really need to wipe the publish SVN repository, then copy the files, then commit.

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文