Execute Deployment Publisher

This publisher builds on the DeploymentPublisher to provide additional processing on the content that has been downloaded in the NuGet package.

When a matching trigger HealthCheck result notification is published (see "TargetHealthCheckName" in Configuration section below for more detail) this publisher executes a two step process (The following "Items" in quotes refer to Configuration settings),
  1. The NuGet package is downloaded from the "Feed" and unpacked into the "DownloadFolder"\"PackageId" folder.
  2. The "Command" is then executed (optionally using identity provided by "Domain", "UserName", "Password") and "Args" can be used to provide command line arguments to your executable.
    1. A notification message is generated based on the ResultCode returned by the process.

Typical Usage

This publisher is intended for use in automated deployment scenarios. If you bundle the "deployable" (this could be an entire website!) into a NuGet package then this plugin will download it and then run an executable to perform the actual deployment - this could be dropkick, msbuild.exe, powershell etc. At the end of the deployment a new notification will be sent with the result of this process.

(A great tip here is to make dropkick.core a dependent package of your NuGet package - when this plugin downloads your NuGet package it will also pull down any dependencies so you don't have to pre-deploy dropkick to the target machine or package it inside your package!)


Once installed a new configuration file will be available, Config\Publishers\exe.deployment.contrib.castle.config...
<component id="ExeDeploymentPublisherConfiguration"
			 type="Wolfpack.Contrib.Deployment.ExecuteDeploymentConfig, Wolfpack.Contrib.Deployment">
		<!-- This is the friendlyId of the NuGet Release Check to monitor -->
		<!-- nuget deployment properties -->
		<!-- execute properties -->
  1. To enable the publisher just set the "Enabled" element value to "true" on the component.
  2. If you are only interested in receiving alerts when the process "fails" (non zero return code) then you can set the "PublishOnlyIfFailure" element to true otherwise you will receive alerts for both success and failure.
  3. "Domain", "Username" & "Password" elements are used to impersonate the identity if the executable needs to be run as someone else.
  4. "Command" element is used to provide the executable command line to execute to run the tests. This can be absolute or relative - if relative then it is relative to the "DownloadFolder" element value.
  5. "Args" is used to specify the arguments to pass to the executable.
  6. "Feed" should be set to the location hosting the NuGet package - leave blank for the official NuGet feed (default).
  7. "PackageId" is the name of the NuGet package to download.
  8. "DownloadFolder" is the folder where the package will be downloaded to. A sub-folder, named with the PackageId will be created and the contents of the NuGet package will extract here. This folder can be absolute or relative, if relative it is to the Wolfpack installation folder.
  9. "TargetHealthCheckName" is the "FriendlyId" of the HealthCheck that this publisher triggers on. Whenever a HealthCheck result notification is published, this publisher will inspect the metadata and if the source HealthCheck matches the "TargetHealthCheckName", the Result is "Success" and there is no Critical Failure it will execute.
  10. Finally, to trigger this deployment publisher we need to enable the "NuGet Release HealthCheck" plugin that was also installed. In the Config\Checks folder should be "triggerdemo.contrib.castle.config". Move this file to the appropriate subfolder, eg: EveryMinute and set the "Enabled" property to true, the remaining properties are already set up to point to the "Demo" package (see below).


The configuration file contains the settings to download a demo nuget package "Wolfpack.Contrib.Demo" from myget.org. This NuGet package has "dropkick.core" as a dependent package so this will also be installed into your "_deploy" folder. The sample configuration file above will download the "Wolfpack.Contrib.Demo" package, the dependent packages (dropkick & nunit runner) and then launch "notepad.exe" to demonstrate an executable running after the download; the natural progression is to package a dropkick deployment in your NuGet package and deploy it with dropkick.exe, other variations would be to launch msbuild.exe, powershell etc.


This publisher, once executed will create a new HealthCheck result notification with the following properties set...
  • Tag = name of package updated
  • Duration
  • Result = true if process result code was zero

  • ErrorCode = result/return code from the launched process

Last edited Apr 19, 2012 at 9:17 AM by jimbobdog, version 3


No comments yet.