Skip to content
jondot edited this page Mar 4, 2011 · 1 revision

An output task is the abstraction of all your typical file operations in the last stages of your build, when you're trying to create a suitable layout for a package. Typically this step is followed by extensive use of FileUtil, mv's, cp's etc.

The output task gives you a simple declarative way to do just that.

output :output => [:test] do |out|
  out.from '.'
  out.to 'out'
  out.file 'bin/release/build.exe', :as=>'build.exe'
  out.file 'LICENSE.txt'
  out.file 'README.md'
  out.file 'VERSION'
end

This is most useful in asp.net / web deployments where things like 'one-click publish' may help you but only to a certain length.

Here is a typical deployment output, involving running ERB on your config file (this is a viable, more powerful, alternate to the new xml transforms)

output :deploy_prod do | o |
  o.from 'my.webservice'
  o.to 'out'

  o.file 'global.asax'
  o.file 'web.config.prod', :as => 'web.config'
  o.erb 'custom_config', :as => 'other.config', :locals => { :password=>'123456' }
  o.dir 'bin'
end

Note: The output task will pre-create any path that it needs. It will drop and create the output path.

Clone this wiki locally