TFS:这可能吗?

发布于 2024-08-16 20:32:33 字数 133 浏览 4 评论 0原文

我们有 3 个环境:开发、测试和登台。

我想签入和签出 TFS。当我们进行更改时,我想将代码提升到开发 Web 服务器。接下来,我想将更改推广到测试,然后推广到登台。使用 Team Foundation Server 可以做到这一点吗?

We have 3 environments: dev, test, and staging.

I want to check in and out of TFS. When we make changes, I want to promote the code to the dev web server. Next I want to promote the changes to test, then to staging. Would it be possible to do this with Team Foundation Server?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(3

后eg是否自 2024-08-23 20:32:33

人们到底为什么建议分支?您可以针对不同的功能进行分支,或者针对发布快照进行静态分支。

当然,这些环境之间的差异在于配置项/文件以及其中的设置。您所需要做的就是让您的部署和发布管理流程井然有序。

创建适当的 MSBuild 任务并使用 TFSBuild(持续集成)调用这些任务,以负责为您正在构建的环境/配置输出正确的配置文件。您可以轻松添加另一个 MSBuild 目标,用于处理相应目标环境的适当部署。

Why on earth are people suggesting branching? You branch for different features or static branches for release snapshots.

Surely the differences between these environments are configuration items/files and settings within these. All you need to do is get your deployment and release management process in order.

Create appropriate MSBuild tasks and use TFSBuild (Continuous Integration) to call these to take care of outputting the correct config files for the Environment/Configuration you are building. You can trivially add another MSBuild target that deals with the appropriate deployment to the respective target environments.

魂归处 2024-08-23 20:32:33

您可以手动签出每个分支的代码,随后对每个分支进行更改,然后签入。 非常小心

更好是让这 3 个环境成为彼此的分支。 (通常从 dev 开始,然后依次分支到其他 2 个)。然后,您可以使用合并功能将(例如)您的开发变更集直接合并到测试等。此时,您的测试模块(需要更改以匹配开发)已被签出,的变化。然后只需提交更改即可。然后重复分级和冲洗。这是针对这种常见场景的建议方法

两个重要注意事项:

  • 尽管 TFS 非常以服务器为中心(例如,与 SVN 相比),但此合并功能发生在客户端上。您需要将每个分支映射到您的计算机。合并过程完成后,您将在目标分支中拥有未提交的更改,直到您签入为止。
  • 在 Microsoft 的愿景和我在这里给出的示例中,这些分支是永久性的。这是我之前使用 SVN 的做法的一个变化,在 SVN 中,整个分支一直被创建/升级/退役。在 TFS 方式中,您创建 Test 分支,并且它无限期地保留为 Test 分支。它从来没有被宣传过;它的更改合并在其他地方。

建造是一个单独的动作。您需要为每种情况设置一个单独的构建,当然,一旦您设置了第一个,其他两个将变得微不足道。合并到staging后,您将运行staging构建。 (从团队资源管理器或“构建”菜单中)。 TFS 有点重,但一旦设置好,它确实可以很好地处理这种情况,便于分布式团队快速合并和构建(通过自动构建测试等)。

You can manually checkout the code from each branch, make your changes subsequently to each branch, and checkin. Very carefully.

Much better is to have these 3 environments be branches of each other. (Typically you start with dev, and branch to the other 2 in turn). Then you can use the Merge functionality to merge (for example) your dev changesets directly to test, etc. At this point your Test modules (that need to be changed to match dev) are checked out, with the changes. Then simply commit the changes. Then repeat for staging and rinse. This is the suggested methodology for this common scenerio.

Two important notes:

  • Even though TFS if very server-centric (compared to SVN, for example), this merging functionality happens on the client. You need to have each branch mapped to your machine. After the Merge process is completed, you'll have uncommitted changes in the target branch until you check in.
  • In Microsoft's vision and in the example I give here, these branches are permanent. This was a change from my previous practice using SVN, where whole branches were created/promoted/retired all the time. In the TFS way, you create the Test branch and it remains, indefinately, the Test branch. It's never promoted; its changes are merged elsewhere.

Building is a separate action. You need to set up a separate build for each situation, though of course once you set up the first one the other two will be trivial. After your merge to staging, you'll then run the staging build. (From Team Explorer or in the Build menu). TFS is a bit heavy but once it is set up it does handle this situation very well, easy for a distributed team to merge and build quickly (with automated build tests, etc.).

甲如呢乙后呢 2024-08-23 20:32:33

是的,这是可能的,但您必须手动将它们从一个分支签入到另一个分支。

Yes, this is possible, but you must manually check them in from one branch to another.

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