1
votes

I have an build definition that will be used for many projects. But when saving to template it's still "locked" to the project.

So I'm trying to use tfpt to clone the definition to a new project.

PS C:\> tfpt builddefinition /collection:"http://localhost:8080/tfs/DefaultCollection" /dump "Test47\*"
Querying Build Definition...
No definitions found matching 'Test47\*'.

The issue is that it doesn't find any of my build definitions, trying dump to view and * to get all, even when typing the actual name of definition it still doesn't work.

2
What kind of build definition it is? vNext or XAML? - ds19
Guessing vNext because it's not XAML - roady

2 Answers

1
votes

There is not a method to copy vNext build definitions from one project to another, neither tfpt command nor TFS API works. You have to use the "Save as a template" feature, however, as you figured out, it only works in the same team project not across project.

For XAML build definitions, you can use the following tfpt command to copy all build definitions from one team project to another:

tfpt builddefinition /Collection:http://tfssevername:8080/tfs/DefaultCollection  /clone "Project1\*" "Project2\" 
0
votes

Testing with XAML build definition. The Syntax of getting outputs of Build Definition settings is:

tfpt builddefinition /dump teamproject\definition /collection:http://tfsservername:8080/tfs/DefaultCollection/

"teamproject\ *" is not supported, you need to specify the build definition name. Check the screenshots below:

enter image description here

enter image description here