如何获取 tfs 构建文件夹名称,在 运行 TFS 构建时在 dropfolder 内生成
How to get the tfs build folder name, generated inside dropfolder while running the TFS build
创建了 TFS 构建定义并自动安排到 运行。还将构建输出复制到服务器位置 (\server\TFSBuildOutput) 的放置文件夹。
构建 运行s 时,会在放置文件夹 (\server\TFSBuildOutput) 中创建一个单独的文件夹,格式为 -
$(BuildDefinitionName)_$(Date:yyyyMMdd)$(Rev:.r)
现在我想获取这个新生成的文件夹的名称以在 powershell 脚本中使用,例如:
$SomePath="D:\TFSBUildOutput\"+$新建文件夹名+"\SomeOtherPath"
谁能帮我做同样的事情。
如果要在 运行 构建时使用它?然后您可以将 "droplocation" OOB 变量传递给构建模板中可用的 shell。
为了完整性请看答案:
$ENV:TF_BUILD_DROPLOCATION
使用上面的 Team Foundation Build 环境变量给出的输出为
\\server-name\TFSBuildOutput\TFSBuildOutput_20150609.2
示例 -
\\USTR-ERL-4608\Build Output\TBR 每日 Build\TBR 每日 Build_20150609.2
创建了 TFS 构建定义并自动安排到 运行。还将构建输出复制到服务器位置 (\server\TFSBuildOutput) 的放置文件夹。
构建 运行s 时,会在放置文件夹 (\server\TFSBuildOutput) 中创建一个单独的文件夹,格式为 - $(BuildDefinitionName)_$(Date:yyyyMMdd)$(Rev:.r)
现在我想获取这个新生成的文件夹的名称以在 powershell 脚本中使用,例如:
$SomePath="D:\TFSBUildOutput\"+$新建文件夹名+"\SomeOtherPath"
谁能帮我做同样的事情。
如果要在 运行 构建时使用它?然后您可以将 "droplocation" OOB 变量传递给构建模板中可用的 shell。
为了完整性请看答案:
$ENV:TF_BUILD_DROPLOCATION
使用上面的 Team Foundation Build 环境变量给出的输出为
\\server-name\TFSBuildOutput\TFSBuildOutput_20150609.2
示例 - \\USTR-ERL-4608\Build Output\TBR 每日 Build\TBR 每日 Build_20150609.2