开发者

Is there any task to copy files from TFS to a folder?

开发者 https://www.devze.com 2023-02-10 00:14 出处:网络
Scenario: I need as part of my deploy scripts I have a task that copy files from a source to a origin.

Scenario: I need as part of my deploy scripts I have a task that copy files from a source to a origin.

Now I have to change the source. Instead of being a normal folder it has to be a location in my TFS.

Is there any task to do it? I can't find any.

I am trying to get the files manually from TFS using something similar to:

<PropertyGroup>
  <TF>"C:\Program Files\Microsoft Vis开发者_StackOverflowual Studio 9.0\Common7\IDE\tf.exe"</TF>
  <TFSourceLocation>$/TFSDIR</TFSourceLocation>
  <SolutionRoot>.</SolutionRoot>
  <RemoteWebRoot>$(DestinationRoot)\DIR</RemoteWebRoot>
  <Copy>xcopy /E /I /R /Y</Copy>
</PropertyGroup>

<Exec Command="$(TF) get $(TFSourceLocation) /force /recursive /version:T /noprompt" ContinueOnError="true" />

I don't have to compile anything. I only need to copy some files that now are stored in TFS to a folder.

Question: Is this the best approach? or exists a task that allows me to copy from TFS to a folder?


I don't understand your question completely, but if you want to download some files from TFS to a folder on the build server, the command you are using is the best option.

Only be aware that you need a workspace configured so TFS knows where to download the files to.

Another option is to use the TF VIEW command:

tf view $/myitem /console /collection:http://mytfsserver:8080/tfs/defaultcollection >c:\localfile

This will show the contents of the item to the console and prints it to c:\localfile. You then get around the workspace issue.

0

精彩评论

暂无评论...
验证码 换一张
取 消