删除由 Jenkins 创建的 TFS 工作区/在 2 个 Jenkins 服务器上构建相同的 TFS 项目

Delete TFS workspace created by Jenkins / Have same TFS project build on 2 Jenkins servers

我有一个基于 TFS 的 Jenkins Freestyle 项目。 我现在有第二个 Jenkins 服务器,它也需要访问这个存储库(不同的业务部门)。 我在第二台服务器上收到此错误:

Mapping '$/MyProject/' to local folder 'C:\JenkinsPathHere\MyProject\' in workspace 'Hudson-MyProject-MASTER'...
FATAL: com.microsoft.tfs.core.exceptions.TECoreException: The workspace Hudson-MyProject-MASTER;MyName already exists on computer JenkinsServer1.

这是设置初始项目时的控制台输出,

Building in workspace C:\JenkinsPathHere\MyProject\
Querying for remote changeset at '$/MyProject/'  
Checking if there exists a mapping for c:\JenkinsPathHere\MyProject...no.
Downloading list of workspaces from http://tfspath:8080/...
Creating workspace 'Hudson-MyProject-MASTER' owned by 'john@shop.com'...
Mapping '$/MyProject/' to local folder 'c:\JenkinsPathHere\MyProject' in workspace 'Hudson-MyProject-MASTER'...
Created workspace 'Hudson-MyProject-MASTER'.

我的问题:

  1. 我可以在两台服务器上都有 MyProject 的工作区吗?如果可以,我该怎么做?

  2. 如果我在两台服务器上都没有 MyProject 的工作区,我该如何从 Server1 中删除工作区?

错误消息告诉您确切的问题:您正在尝试重复使用工作区名称。每个用户的工作区名称必须是唯一的。我对 Jenkins 不是很熟悉,但我相信您可以在工作区名称中包含代理名称或类似名称。