问题
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
- destination directory ="Build Drop Location"
BuildDetail.DropLocation
- 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
回答1:
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))
来源:https://stackoverflow.com/questions/16267283/copy-files-from-tfs-to-build-drop-location-using-copy-directory-activity