By default, TFS Team Build creates a new folder in the drop location for every build. I have seen request from people that wonder how to always have team build put the output in the same folder every time, effectively overwriting the results from the last build. This is easy to accomplish by adding an activity that copies the drop folder to a fixed location.
To copy the result of the build to a fixed location, you need to modify the build process template:
- Open the build process template XAML file in the workflow designer.
- Click on the Collapse All link in the upper right corner so that only the top level activities are shown
- Open the Toolbox window and locate the CopyDirectory activity (it is located in the Team Foundation Build Activities tab)
- Drag the CopyDirectory activity onto the design surface and drop it between the Run On Agent and the Check In Gated Changes for CheckInShelveset Builds activity:
- Right click on the CopyDirectory activity and select Properties. Fill out the properties, you will of course need to modify the path for the destination accordingly:
- Save the build definition and check it in. NB: Remember to check in the build process template file after modifying it, a lot of times people forget this step!
- Queue a new build and, after the build has succeeded, verify that the build output has been copied to the corresponding output path
To make this build process template more generic, you proabably want to create a process parameter that lets you define the path either when you create a new build definition, or when you queue the build (or both). This will let you you reuse the build process template for builds with different output paths