Learn to use Visual Studio, Visual Studio Online, Application Insights and Team Foundation Server to decrease rework, increase transparency into your application and increase the rate at which you can ship high quality software throughout the application lifecycle
Release Management provides the option to trigger a release from a build. But to use this feature, some additional logic has to be added to the default build process template. This article details how to make the necessary modifications.
If you are using the TFS 2013 default build process template all you need to do is use the corresponding release management build process template.
If you have customized the TFS 2013 default build process template (GitTemplate.12.xaml or TfvcTemplate.12.xaml), then you can use the snippets file (ReleaseTemplate.12.Snippets.xaml) to help you integrate the release-specific customizations into your own custom build process template.
The snippets file only contains sections with start / end markers to indicate which parts to copy.
The following is a sample section with start / end tags that is surrounded by some context.
<x:Members> <!-- RM : START –> <x:Property Name="ConfigurationsToRelease" Type="InArgument(s:String)" /> <x:Property Name="ReleaseBuild" Type="InArgument(x:Boolean)" /> <x:Property Name="ReleaseTargetStage" Type="InArgument(x:String)" /> <!-- RM : END --> </x:Members>
Where <x:Members> ... </x:Members> indicate the context and everything between the start / end tags indicates what to copy as is (yellow).
The only exception is the Activity element, where you will need to copy the attributes in the snippets file and add them to your custom build process template, without removing any existing attributes.
<Activity this:Process.ReleaseBuild="False" xmlns:mtc="clr-namespace:Microsoft.TeamFoundation.Client;assembly=Microsoft.TeamFoundation.Client" xmlns:mw="clr-namespace:Microsoft.Win32;assembly=mscorlib" xmlns:sco="clr-namespace:System.Collections.ObjectModel;assembly=mscorlib">
Consider the following when using the Release Management build process template.
For more clarity on points (2) and (3) above please see the sample image below.
How do you specify the component in the buildtemplate if the release template includes multipel components?
@Stefan, when dealing with multiple components, you can add them to the Release Template in the Toolbox. Right click on the Components node and select Add. You can then drag each of them from the Toolbox to the Deployment Sequence. Each instance will be uniquely identified. Each component can be used in each Stage, as each stage contains a different deployment sequence.
Our system is built with multiple subsystem with individual builds definitions in tfs. I have configured one release template with several components for each subsystem to be able to release the complete system to one environment. That means the modified build template that starts the release pipeline does not includes all the components i need for the release. In my case it would be OK to have a way to get the latest build for the other components in my release template. Any suggestions to solve this issue?
@Stefan, the RTM version of RM is not capable of doing what you ask. However, this is something that our team has been considering.
The scenario would be as you describe. Your components are built externally, whenever you trigger a build that is associated to the corresponding release template, the respective latest bits for those components externally built will be pulled in.
@Leo: These templates seem to miss the functionality for swapping the .token files?
@Jakob, let me take a look. Are you coming from a previous version? I'll double check if we had removed that logic.
I also do not see a sequence for initializing tokens in GitTemplate.12.xaml. Is there a version that contains token functionality?
@Nick, thank you for your feedback. We are currently looking into this. We plan to update all release build process templates to include this logic. Keep track to this post, as I will update it as soon as we have something to share.
@Jakob / @Nick, I have updated the build process templates to include support for ".token" files. Download the zip file again and replace your existing templates with this one. Let me know if this satisfies your needs. Thanks again for bringing it to our attention.
Is this possible with TFS 2012 build? I cannot merge the snippets succcessfully.
The property (ConfigurationsToBuild) is either invalid or not defined
I just noticed in the ReleaseManagement/bin folder there is an 11.1 template for TFS 2012.