是否可以在不绑定到特定机器的情况下使用 TFS 工作区? [英] Can TFS workspaces be used without being tied to a specific machine?

查看:29
本文介绍了是否可以在不绑定到特定机器的情况下使用 TFS 工作区?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以我遇到了一个有 10 个开发人员的项目的情况.每位开发者在当天进来时,会随机分配一台机器用于当天的开发.机器名称不同,比如 DEV01 - DEV10.在发给开发者的时候,机器是一样的,开发者白天做的任何更改都不会持久化在机器上(源代码更改存储在 TFS 中,而不是本地).这些当然实际上是虚拟机,但这与手头的点并不真正相关.

So I've got a situation where we have a project with 10 developers. Each developer, when they come in for the day, is randomly issued a machine to use for development that day. The machine names are different, say DEV01 - DEV10. At the time that they are issued to the developers, the machines are identical, and no changes the developers make during the day are persisted on the machines (source code changes are stored in TFS, not locally). These are of course actually virtual machines, but that's not really relevant to the point at hand.

问题是每天早上,开发人员都会遇到 3 个问题:

The problem is that each morning, the developers run into 3 issues:

1) 分配给它们的机器可能与上次分配给它们的机器不同.例如,DevMan A 可能昨天使用了 DEV04,今天收到了 DEV06.他的工作区定义现在与 DEV06 相关联;他必须创建一个新的工作区,或者将旧的工作区迁移到 DEV04.

1) The machine that they are assigned may not be the same machine they were last assigned to. For example, DevMan A might have used DEV04 yesterday, and received DEV06 today. His workspace definitions are now tied to DEV06; he must create a new workspace, or migrate the old workspace to DEV04.

2) 分配给他们的机器昨天可能已经在使用,有些映射可能会发生冲突.例如,DevMan A 今天可能有 DEV04,并希望创建一个将项目文件夹映射到C:\MyProj\Solution"的工作区.然而,DevMan B 昨天有 DEV04,他使用了相同的项目文件夹.TFS 现在抱怨.

2) The machine that they are assigned may have been in use yesterday, and some of the mappings may conflict. For example, DevMan A might have DEV04 today, and wish to create a workspace mapping the project folder to "C:\MyProj\Solution". However, DevMan B had DEV04 yesterday, and he used the same project folder. TFS now complains.

3) 这可能是他们第一次在给定的机器上.他们现在需要为这台机器重新创建新机器的所有源代码控制映射.

3) This may be the first time they are on a given machine. They now need to recreate for this machine all of their source-control mappings for the new machine.

所有这些问题都可以根据具体情况以简单的方式解决,但它确实会从早上开始降低一些工作效率.我们更希望 TFS 工作区定义可以放宽",这样它们就不会以某种方式在定义中包含机器名称.除此之外,如果有人知道可以自动运行或在用户干预有限的情况下解决上述问题的解决方案,那也将是理想的.

All of these issues can be resolved in a straightforward fashion on a case-by-case basis, but it does sap some productivity from the morning. We'd much prefer if the TFS workspace definitions could be 'relaxed', such that they did not include the machine name in the definition somehow. Barring that, if anyone is aware of a solution to the above problems that can run automatically, or with limited user intervention, that would also be ideal.

推荐答案

首先,超级明显的答案是将机器专用于用户.

First, the super-obvious answer is to dedicate machines to users.

其次...如果您真的想按照说明解决问题:

Secondly... if you really want to solve the problem as stated:

如果不将工作区分配给特定机器,则无法使用工作区.这个假设隐含在产品中.但你可以欺骗它:)
警告:这个方法似乎有效,但我个人没有使用它运行项目.

You cannot use workspaces without assigning them to a specific machine. This assumption is implicit in the product. But you can fool it :)
Warning: This recipe seems to work but I have not personally run a project using it.

  1. 为每个用户分配一个虚拟"机器名称,即 UseridVM
  2. 对于每个虚拟机,都需要以下(持久性或启动脚本)设置:
    • 创建一个新的环境变量用户变量",即 _CLUSTER_NETWORK_NAME_=UseridVM

现在,当用户打开 Visual Studio 时,工作区将使用指定值UseridVM"作为机器名称,因此在每台机器上都会找到相同的工作区.

Now, when the user opens up Visual Studio, the workspace will use the specified value "UseridVM" as the machine name, thus the same workspace will be found on each machine.

如果您没有永久虚拟硬盘,那么每个用户在开始新的一天时必须确保执行真正的"获取最新版本"(获取特定版本,选中所有框),因为工作区会记住什么文件已经下载,如果感觉它们已经存在,则不会重新下载.

If you don't have a persistent virtual hard drive, then each user must be sure to do a 'real' "Get Latest" (Get Specific Version, check all boxes) when starting for the day because the workspace memorizes what files have already been downloaded and will not re-download them if it feels they already exist.

这篇关于是否可以在不绑定到特定机器的情况下使用 TFS 工作区?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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