Sunday, 23 November 2014

How to Trigger a Release in VS Release Management from TFS Build

To enable triggering a release in Visual Studio Release Management from TFS build requires few configuration steps to be performed.
First step is to allow triggering a release in the Release Template. This can be done in release template properties.
001
Select “Can Trigger a Release from a Build?” option.
002
Next step is to change the TFS build template to Special Template capable of triggering a release. If there is customized build template being used currently, it is possible to change it to support triggering a release. How to do that explained in below link.
http://blogs.msdn.com/b/visualstudioalm/archive/2013/12/09/how-to-modify-the-build-process-template-to-use-the-option-trigger-release-from-build.aspx
003
004
If default build template is used as shown above, change it to template available with Release Management Client. This can be found at below shown location of a Release management Client installed machine.
005
Add ReleaseTfvcTemplate.12 to build process templates and select it as the build template in the build definition. If TFS 2012 ReleaseDefaultTemplate.11.1 should be used. If Git is used as source control repository ReleaseGitTemplate is available.
006
007
008
This template has a category for Release.
009
Set Release Build to true.
010
To demonstrate the release with TFS build, below simple ASP.Net web application is altered with a simple change and tested in Development environment.
012
013
The depsvr which is configured to deployed using VS Release Management still has old version and development (localhost) shows the change,
014
Check in the change.
015
CI build (Build each check in) is successful.
016
Next step is to trigger a build with output and initiate a release via that build.
017
018

Wait for release to be triggered with the TFS build.
019

New release is not triggered and Build failed with “Build service account needs to be a system user in Release Management Server”.
 020
021
Add the TFS Build Service account as a service account in Release Management.
022
023
024 .
Retry Build.
025
Second attempt failed with same error.
027
028
The Q&A in below link gives a hint.
http://stackoverflow.com/questions/20901507/error-the-account-running-the-tfs-build-service-tfsbuildservices-needs-to
Hint is the build server needs to be installed with Release Management Client and configured to access Release Management Server.
030
031
032
033
Next attempt of the build successfully triggers the release in Release Management Server.
034
035
Acceptance Deployment step should be set to automated in release path of Release triggered by a TFS Build.
036
Build succeeds and Release succeeds.
037
038
DepSvr is updated with the change in the Demo web application.
039

1 comment:

Suncakes said...

hi there

this only works with microsoft solutions. do you have any ideas on how to get it working with java solutions. EG, war files?

Popular Posts