Skip to content

Instantly share code, notes, and snippets.

@jkodroff
Created February 20, 2013 21:17
Show Gist options
  • Save jkodroff/4999695 to your computer and use it in GitHub Desktop.
Save jkodroff/4999695 to your computer and use it in GitHub Desktop.
Psake snippet - Deploying an NServiceBus Endpoint
task ServiceEndpoints {
deploy_endpoint "RelocationMoverServices.Synergize.Handlers"
}
function global:deploy_endpoint($name) {
$project = "$BaseDir\src\$name\$name.csproj"
$buildPath = "$DeployBaseDir\$name"
$deployPath = "c:\ReloDotNet2_ServiceEndpoints\$name"
exec { msbuild $project "/p:Configuration=Debug;OutputPath=$buildPath" "/t:Build" }
exec { configFileSwapper\ConfigFileSwapper.exe "-settingsFilePath=$TargetEnvironmentSettingsFile" "-sourceConfigFilePath=$buildPath\$name.dll.config" }
if (Test-Path $buildPath\packages.config) {
ri "$buildPath\packages.config"
}
exec { & "$deployPath\NServiceBus.Host.exe" /uninstall /servicename:$name }
exec { msdeploy "-verb:sync" "-source:contentPath=$buildPath" "-dest:contentPath=$deployPath" }
exec { & "$deployPath\NServiceBus.Host.exe" /install /servicename:$name }
exec { & "sc.exe" start $name }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment