{"id":2163,"date":"2013-12-09T20:44:00","date_gmt":"2013-12-09T20:44:00","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/visualstudioalm\/2013\/12\/09\/how-to-modify-the-tfs-2013-default-build-process-template-gittemplate-12-xaml-tfvctemplate-12-xaml-to-enable-releasing-from-a-build\/"},"modified":"2022-07-18T08:41:54","modified_gmt":"2022-07-18T16:41:54","slug":"how-to-modify-the-tfs-2013-default-build-process-template-gittemplate-12-xaml-tfvctemplate-12-xaml-to-enable-releasing-from-a-build","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/devops\/how-to-modify-the-tfs-2013-default-build-process-template-gittemplate-12-xaml-tfvctemplate-12-xaml-to-enable-releasing-from-a-build\/","title":{"rendered":"How to modify the TFS 2013 default build process template (GitTemplate.12.xaml &amp; TfvcTemplate.12.xaml) to enable releasing from a build"},"content":{"rendered":"<p>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.<\/p>\n<h2>If you are currently using the TFS 2013 default build process template<\/h2>\n<p>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.<\/p>\n<ul>\n<li>If using <span style=\"font-family: consolas\">GitTemplate.12.xaml<\/span> then use <span style=\"font-family: consolas\">ReleaseGitTemplate.12.xaml<\/span>.<\/li>\n<li>If using <span style=\"font-family: consolas\">TfvcTemplate.12.xaml<\/span> then use <span style=\"font-family: consolas\">ReleaseTfvcTemplate.12.xaml<\/span>.<\/li>\n<\/ul>\n<h2>If you are currently using a customized TFS 2013 build process template<\/h2>\n<p>If you have customized the TFS 2013 default build process template (<span style=\"font-family: consolas\">GitTemplate.12.xaml<\/span> or <span style=\"font-family: consolas\">TfvcTemplate.12.xaml<\/span>), then you can use the snippets file (<span style=\"font-family: consolas\">ReleaseTemplate.12.Snippets.xaml<\/span>) to help you integrate the release-specific customizations into your own custom build process template.<\/p>\n<h2>Modifying your own custom build process template<\/h2>\n<p>The snippets file only contains sections with start \/ end markers to indicate which parts to copy.<\/p>\n<p>The following is a sample section with start \/ end tags that is surrounded by some context.<\/p>\n<p><span style=\"font-family: consolas\"><x:Members> <br \/><span style=\"background-color: #ffffff\"><span style=\"background-color: #00ff00\">\u00a0 <!-- RM : START \u2013> <br \/><\/span><\/span><\/span><span style=\"font-family: consolas;background-color: #ffff00\">\u00a0\u00a0\u00a0 <x:Property Name=\"ConfigurationsToRelease\" Type=\"InArgument(s:String[])\" \/> <br \/>\u00a0\u00a0\u00a0 <x:Property Name=\"ReleaseBuild\" Type=\"InArgument(x:Boolean)\" \/> <br \/>\u00a0\u00a0\u00a0 <x:Property Name=\"ReleaseTargetStage\" Type=\"InArgument(x:String)\" \/> <br \/><\/span><span style=\"font-family: consolas\"><span style=\"background-color: #00ff00\">\u00a0 <!-- RM : END --><\/span> <br \/><\/x:Members><\/span><\/p>\n<p>Where <span style=\"font-family: consolas\"><x:Members> &#8230; <\/x:Members><\/span><span style=\"font-family: calibri\"> indicate the context and everything between the start \/ end tags indicates what to copy as is (<span style=\"background-color: #ffff00\">yellow<\/span>).<\/span><\/p>\n<p>The only exception is the <span style=\"font-family: consolas\">Activity<\/span> 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.<\/p>\n<p><span style=\"font-family: consolas\"><Activity <span style=\"background-color: #ffff00\">this:Process.ReleaseBuild=&#8221;False&#8221; xmlns:mtc=&#8221;clr-namespace:Microsoft.TeamFoundation.Client;assembly=Microsoft.TeamFoundation.Client&#8221; xmlns:mw=&#8221;clr-namespace:Microsoft.Win32;assembly=mscorlib&#8221; xmlns:sco=&#8221;clr-namespace:System.Collections.ObjectModel;assembly=mscorlib&#8221;<\/span>><\/span><\/p>\n<h2>Using the Release Management build process template<\/h2>\n<p>Consider the following when using the Release Management build process template.<\/p>\n<ol>\n<li>When using the functionality to automatically trigger Releases from a Build, you will need to install a Release Management client on your TFS Build Server. After installation, restart the TFS Build Services.<\/li>\n<li>While editing the Build Definition, Set the <strong>Release Build<\/strong> parameter to **TRUE, **to indicate that you want the build to be released.<\/li>\n<li>Specify the Target Stage for the Release in the <strong>Release Target Stage<\/strong> parameter. Leave blank to allow the Release to go through all the Stages defined in the Release Path. The check is case sensitive so make sure to match the name of the Target Stage verbatim.<\/li>\n<li>Ensure the Release Template is configured to match the Build Definition and the property <strong>Can Trigger a Release from a Build?<\/strong> is set.<\/li>\n<\/ol>\n<p>For more clarity on points (2) and (3) above please see the sample image below.<\/p>\n<p><img decoding=\"async\" style=\"padding-top: 0px;padding-left: 0px;margin: 0px;padding-right: 0px;border-width: 0px\" title=\"image\" src=\"https:\/\/devblogs.microsoft.com\/devops\/wp-content\/uploads\/sites\/6\/2013\/12\/3733.image_thumb_16F8AF22-1.png\" alt=\"image\" width=\"244\" height=\"147\" border=\"0\" \/><\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/6\/2019\/02\/ReleaseTemplate.12.zip\">ReleaseTemplate.12.zip<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>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 currently using the TFS 2013 default build process template If you are using [&hellip;]<\/p>\n","protected":false},"author":65,"featured_media":45953,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[253,226,1],"tags":[],"class_list":["post-2163","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-azure-devops-server","category-ci","category-devops"],"acf":[],"blog_post_summary":"<p>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 currently using the TFS 2013 default build process template If you are using [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/posts\/2163","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/users\/65"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/comments?post=2163"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/posts\/2163\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/media\/45953"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/media?parent=2163"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/categories?post=2163"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/tags?post=2163"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}