Skip to content
Henrik edited this page Aug 21, 2014 · 1 revision

We removed the msdeploy.exe command-line application wrapper. It was getting out of hand trying to keep track of all the versions and installed locations (including registry and file system searching). In addition, msdeploy had a reputation for bad behavior... namely, never returning a non-zero exit code, even in the case of a true failure (which prevents you from knowing if your deploy task is failing or depending on a dry-run).

You can build the packaging/deploy settings into your website project(s). And define a task for creating the msdeploy package (or combine it with your normal build, but, due to the pipeline and build time, I always find myself separating).

I think, with the default settings, you just tell msbuild to "deploy on build", which, in this case, just creates the package in some goofy path.

msbuild :package => [:build] do |cmd|
  cmd.solution = "mysolution"
  cmd.targets = [:build]
  cmd.properties = {
    :configuration => "Release",
    :platform => "Any CPU",
    :deployonbuild => true
  }
  cmd.verbosity = :minimal
  cmd.no_logo
end

You can define an exec task that runs the built msdeploy cmd file.

exec :deploy do |cmd|
  cmd.command = "path/to/deploy.cmd"
  cmd.parameters = ["/Y"]
end

There are other methods for building the package, including something with publish profiles, different targets, and even setting the output path (useful for multiple website projects). We'd like to collect canonical examples here.

We'd also like to collect some examples on manually determining success/failure, because, as it stands, the basic exec task above will always "pass".

Clone this wiki locally