情况:
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
。这意味着问题出在该守护程序的环境中。