【发布时间】:2020-06-10 14:49:23
【问题描述】:
情况:
TFS 2018
构建过程包括两个阶段——分别在 Windows 和 Linux 代理上执行
Get sources(TFVC) 将Clean标志设置为false
问题:
- Linux 代理(与其对应的不同)忽略
Clean标志 -- 它始终执行tf workspace -delete、... -new等。
我添加了“打印变量”步骤,可以清楚地看到Build.Repository.Clean 在每个阶段都是false。
有没有办法解决这个问题?
更多信息:
将system.debug 设置为true 会产生有趣的日志:
Querying workspace information.
##[debug]tf workspaces -format:xml "-collection:<tfs-server-url>" -jwt:******** -noprompt
##[debug]No workspace matching *;Project Collection Build Service (<collection-name>) on computer <computer-name> found in Team Foundation Server <tfs-server-url>.
##[debug]<?xml version="1.0" encoding="utf-8"?><workspaces/>
##[debug]Sources directory does not exist or is empty.
##[debug]tf workspaces ws_1_14 -computer:* -format:xml "-collection:<tfs-server-url>" -jwt:******** -noprompt
##[debug]No workspace matching ws_1_14;Project Collection Build Service (<collection-name>) on computer * found in Team Foundation Server <tfs-server-url>.
##[debug]Deleting: '/home/<user>/agent/_work/1/s'.
##[command]tf workspace -new -location:local -permission:Public ws_1_14 "-collection:<tfs-server-url>" -jwt:******** -noprompt
Workspace 'ws_1_14' created.
但是当我登录到那台机器并自己运行这些命令时(没有-jwt:... -noprompt)——我得到了关于ws_1_14 工作区的正确信息。代理正在作为通过sudo ./svc.sh install; sudo ./svc.sh start 创建的守护程序/服务执行。这意味着问题出在该守护进程的环境中。
【问题讨论】:
-
您可以将“system.debug”变量设置为“true”的构建排队,然后共享构建日志吗?您是否在 Get Sources 和构建步骤中都将
Clean设置为false?你是如何映射你的文件夹的? -
@CeceDong-MSFT 我已经用其他信息更新了我的帖子。知道如何追踪为什么代理从 TFS 获得“无工作区...”响应吗?
标签: tfs azure-devops tfsbuild