使用复制目录活动从 TFS 复制文件以构建放置位置 [英] copy files from TFS to build drop location using copy directory activity

查看:19
本文介绍了使用复制目录活动从 TFS 复制文件以构建放置位置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的情况,当我的构建成功时,我想从文件夹 TFS 复制以构建放置位置
我正在使用复制目录活动,在复制活动目录中

  1. 目标目录 ="构建放置位置"

<块引用>

BuildDetail.DropLocation

  1. 源目录="TFS Flder"

我知道构建代理从 TFS 获取源代码到它的机器到这个路径

<块引用>

$(SystemDrive)\Builds\$(BuildAgentId)\$(BuildDefinitionPath)

,那么我想如何获得此路径以在复制活动中使用它

解决方案

在构建工作流 SourcesDirectory 中有一个属性保存源文件夹,如果你没有对源代码做任何花哨的事情并且定义是基于默认的,它应该是你的需要.

基于以下内容

String.Format("{0}\Sources", BuildDirectory)

BuildDirectory 是从构建过程中检索的,并且通常是在代理中定义为链接的位置 ($(SystemDrive)\Builds\$(BuildAgentId)\$(BuildDefinitionPath))

my case , i want to copy from Folder TFS to build drop location when my build succeeded
i am using copy directory activity, in copy activity directory

  1. destination directory ="Build Drop Location"

BuildDetail.DropLocation

  1. source directory ="TFS Floder"

i know that build agent get source code from TFS to its machine on to this path

$(SystemDrive)\Builds\$(BuildAgentId)\$(BuildDefinitionPath)

, so how i want to get this path to use it in copy activity

解决方案

There is property in build workflow SourcesDirectory that holds the source folder, if you are not doing anything fancy with sources and definition is based on default it should be what you need.

Its based on following

String.Format("{0}\Sources", BuildDirectory)

The BuildDirectory is retrieved from build process and is the location defined in agent usualy as your linked ($(SystemDrive)\Builds\$(BuildAgentId)\$(BuildDefinitionPath))

这篇关于使用复制目录活动从 TFS 复制文件以构建放置位置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆