To integrate Deployment Manager with TFS you need to call two command lines from your build definition:
- RgPublish.exe to create and publish your applications to Deployment Manager.
- DeploymentManager.exe to create a release and (optionally) deploy to an environment that you've defined.
For example, when publishing an ASP.NET web app for deployment, call:
RgPublish /source="C:\Source Code\My Web App\MyWebApp.csproj" /configuration=Release /platform=x86 /target=feed:http://MyDeploymentManagerServer:8080/nuget/
And to deploy to staging for the associated project, call:
DeploymentManager create-release --server=http://MyDeploymentManagerServer:8080/ --apiKey=ABC94PPM3DZGHCQSIJRAPWE7TG --project=MyProject --deployto=Staging --waitfordeployment
Calling command lines and correctly logging messages and errors from TFS isn't always straight forward. I created a custom build template that allows for better integration of the Deployment Manager tools into TFS.