Release Management - Continuous Deployment with Visual Studio Online and any CI Systems

Release Management - Continuous Deployment with Visual Studio Online and any CI Systems

  • Comments 6

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’

Argument

Usage

MyReleaseTemplateName

Name of the release template to use with this release. Value is Case sensitive

MyPackageLocation

The drop location of the build. This will be used as your source through the entire Release Path.

ReleaseTargetStage

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.

  1. When using the functionality to automatically trigger Releases from a Build, you will need to install the Release Management client on your Build Agent machine. After installation, restart the TFS Build Agent. This is so that the needed file are available locally on the machine and the provided build template knows where to find them.
  2. The Components defined in RM must have its source set as Builds externally. From the three parts of the UNC Path to Package, only the last (package subfolder) will be used and appended to the –pl argument value given in the command.
  3. In the Build Definition, Build Defaults section, select the Build Controller connected to your on prem agent. Also set the Staging location to be Copy build output to the following drop folder to have the output of the build accessible to your deployment agents.
  4. While editing the Build Definition, Set the Release Build parameter to True, to indicate that you want the build to be released.
  5. Specify the Target Stage for the Release in the Release Target Stage parameter. If left blank the Release will 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.
  6. Specify the name of the Release Template you wish to deploy in the Release Template field. This too is case sensitive.
  7. Make sure that the account running your build is a Service User within RM (while viewing a User, set the Is a Service User? field to Yes.

  

Attachment: ReleaseCMDTemplate.12.Snippets.xaml
Leave a Comment
  • Please add 3 and 8 and type the answer here:
  • Post
  • The snippets file you have posted is  missing the following:

    xmlns:si="clr-namespace:System.IO;assembly=mscorlib" (in <Activity>)

    and

       <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?

  • @Adam Plocher

    Thanks, TfvcTemplate.12.xaml was updated after this post. I have now updated the snippets file.

    @Frank Jona

    This is not possible at the moment. But it is in our backlog.

    @Dan

    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.

Page 1 of 1 (6 items)