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
[Update: The technique described below is only valid for Agent-Based release templates. To achieve similar behavior for vNext release templates, follow the instructions from the article Trigger Release from build with Release Management for Visual Studio 2013 Update 3.]
Visual Studio Release Management 2013 Update 2 RC release ships with an updated Release command line tool.
The new options of that command line tool opens new possibilities in terms of continuous deployment (triggering a Release from a check-in/build). You can now trigger a Release from any CI Server. You can also implement continuous deployment with RM and Visual Studio Online if the TFS build agent used is on prem. This article will focus on RM and VS Online, but the information here can help in setting up RM with any CI Server.
Build Template modification
In order to trigger a new Release, we need to add a process call to the RM command line tool within your build execution. The process command will look like this:
ReleaseManagementBuild.exe –rt ‘MyReleaseTemplateName’ –pl ‘MyPackageLocation’ –ts ‘ReleaseTargetStage’
Name of the release template to use with this release. Value is Case sensitive
The drop location of the build. This will be used as your source through the entire Release Path.
The final state to deploy this build too. This value is optional. If left blank the build will be released to all stages. Value is Case sensitive.
When using TFS, modify your build template by following the steps of the “Modifying your own custom build process template” section of the following article. However, make sure to use the snippets file attached to this article.
Triggering a build
Once the build template modifications are applied, the build definition will show a new section of parameters. Consider the following when using the Release Management build process template.
The snippets file you have posted is missing the following:
xmlns:si="clr-namespace:System.IO;assembly=mscorlib" (in <Activity>)
<x:Property Name="ProcessReleaseTokens" Type="InArgument(x:Boolean)" />
<x:Property Name="ReleaseTokensFolderPath" Type="InArgument(x:String)" />
If you try to merge with TfvcTemplate.12.xaml you'll get errors without those lines.
One question regarding the -pl parameter. Is it possible to add more than one package location, e. g. for each component a single pl? With the client you're able to. Let's assume you added 2 components with Builds externally than the client is asking for 2 locations....
Where is the "Modifying your own custom build process template" section of this article? Am I missing something?
Thanks, TfvcTemplate.12.xaml was updated after this post. I have now updated the snippets file.
This is not possible at the moment. But it is in our backlog.
That section is in the linked article. I will change the wording to make it more obvious.
Is there any way to see deployment errors returned when this command is executed? Currently it states "ERROR: The deployment for release template '<template>' has not been completed successfully. Check the releases history for more details."
@Tommy The specific error(s) (and logs) are only available in the corresponding Release. You will need to open up the ReleaseManagement client to diagnose further.
Is there any update on Release Management which allows it to connect with VisualStudio.com now?
We are using VSO online and wish to use Release Management for its out-of-the-box functionality for continuous delivery but not sure if we can do as of yet?
Thanks for the help.
Hi, great article, thanks.
ReleasemanagementBuild.exe -rt "MyReleaseTemplateName" works, but
ReleasemanagementBuild.exe -rt "MyVNextReleaseTemplateName" etc. fails with error:"an active release template named MyVNextReleaseTemplateName was not found
Any ideas? Thanks
This won't work with vNext Release Templates. For those, you can use new REST API calls to trigger the releases. Review this article for the instructions: blogs.msdn.com/.../trigger-release-from-build-with-release-management-for-visual-studio-2013-update-3.aspx
It appears the web api is the one to use for vNext release templates.
however, I can't get those to work either, (as per the comments on linked page)