I have some TFS 2010 build definitions that were created under ProjectX. Now the source code has moved to a folder subordinate to ProjectY. How can I move the build definitions to ProjectY so they display under the Builds node of the Team Explorer for ProjectY?
相关问题
- Getting error: File extension specified '.webt
- Using TFS command line tf.exe how can I copy a rep
- TFS Power tools Migrate doesn't actually migra
- What is the difference between tfpt scorch and tfp
- TFS 2017 Agent: and error occured while sending th
相关文章
- Is it possible to do a “destroy history” in TFS?
- How do I make a TeamCity build appear in the TFS B
- TFS vs. JIRA/Bamboo/SVN [closed]
- Why doesn't my .tfignore file ignore my packag
- Is it possible to create a docker container from T
- How to Move TFS 2010 Build Definition between Proj
- How to fix TF246017 The Team foundation server cou
- How to open TFS Power Tools - Alerts Explorer
A powershell version of Sean's answer above
Build definitions are just another source controled file in TFS, you should be able to open the build definition in ProjectX and save it as a new file to projectY's build definitions folder.
Edit
In the above post I am assuming ProjectX and ProjectY are TFS projects, in which case their workflow build definition(s) are simply in the builddfinitions folder of their respective source control roots.
In VS2010, the TFS Power Tools can move a build definition from one project to another as demonstrated in the 2nd answer in this link: Is it possible to Export TFS 2010 Build Definitions?, and as shown below.
The TFS Power Tools for VS2010 can be downloaded from: http://visualstudiogallery.msdn.microsoft.com/c255a1e4-04ba-4f68-8f4e-cd473d6b971f
I don't think there is something out of the box to copy the build definitions from one project to another. However you should be able to do it using the TFS API. You will want to move the build process templates, which is what Pete is referring to, into the Build Process Template folder for the new project. After that you would do something like:
A couple of things to note. You will need deal with converting the workspace mappings from one project to the other. You will also need to change the buildDefinition.Process line to find the specific template.
Uggly but very efficient way to move (not to duplicate) only one or two Build Definitions:
That's it ;)
To determine the GroupId of the target Team Project, simply find any BuildDefinition of that Team Project in tbl_BuildDefinition and take its GroupId.
For sure, you have next to update the BuildDefinition's workspace, Items to build, ... to use the server path of the new Team Project !
If you get an error like "GroupItem cannot be move accross Team Project" when updating your BuildDefinition, it was most probably already open before updating the DB. Close and reopen it.
If you don't intend to repeat this operation too often, it's IMO the fastest solution.
V.
Sean's answer helped me out, but in my case, I have only one repository for my build templates and custom activities assemblies. So I don't need to edit settings, I just want to copy one build definition from TFS Project A to TFS Project B. Here is my 'short' version of Sean's code: