TFS工作区可以使用,而不必绑定到特定的机器上?(Can TFS workspaces be used without being tied to a specific machine?)

编程入门 行业动态 更新时间:2024-10-22 23:15:54
TFS工作区可以使用,而不必绑定到特定的机器上?(Can TFS workspaces be used without being tied to a specific machine?)

所以我有一个情况是我们有一个10个开发人员的项目。 每个开发者当他们进来时,都是随机发放一台机器用于当天的开发。 机器名称不同,比如DEV01 - DEV10。 在发布给开发人员时,这些机器是相同的,并且开发人员在白天不做任何更改都会保留在机器上(源代码更改存储在TFS中,而不是本地)。 当然这些实际上是虚拟机,但这与手头上的问题无关。

问题在于,每天早上,开发者遇到三个问题:

1)它们分配的机器可能不是它们最后分配给的机器。 例如,DevMan A昨天可能使用了DEV04,并且今天收到了DEV06。 他的工作区定义现在绑定到DEV06; 他必须创建一个新的工作区,或者将旧的工作区迁移到DEV04。

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

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

所有这些问题都可以在个案基础上以简单明了的方式解决,但它确实会从早晨节省一些生产力。 我们更喜欢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.

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

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) 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) 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.

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.

最满意答案

首先,非常明显的答案是将机器专用于用户。

其次......如果你真的想按照所述解决问题:

不能将工作空间分配给特定的机器。 该假设隐含在产品中。 但你可以欺骗它:) 警告:这个配方似乎工作,但我没有亲自运行一个项目使用它。

为每个用户分配一个“虚拟”机器名称,即UseridVM 对于每个虚拟机,需要以下(持久或启动脚本)设置: 创建一个新的环境变量“用户变量”,即_CLUSTER_NETWORK_NAME_ = UseridVM 很高兴有:使用专用于用户标识的虚拟硬盘驱动器映射(或使用脚本挂载)到“D:”,它跟随用户从VM到VM。

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

如果您没有固定的虚拟硬盘驱动器,则每个用户在开始一天的工作时都必须确保执行“真正的”“获取最新”(获取特定版本,选中所有框),因为工作区会记忆已经存在的文件被下载并且如果感觉它们已经存在则不会重新下载它们。

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.

Assign a "Virtual" machine name for each user, i.e UseridVM For each virtual machine the following (persistent or startup scripted) setup is needed: create a new environment variable "User Variable" i.e _CLUSTER_NETWORK_NAME_=UseridVM Nice to have: Use a virtual hard drive which is dedicated to the user id and mapped (or mounted using a script) to "D:" which follows the user from VM to VM.

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.

更多推荐

本文发布于:2023-07-23 00:48:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1225158.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:可以使用   绑定   而不必   工作   机器上

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!