On Fri, Jun 20, 2008 at 8:36 AM, spike grobstein <[EMAIL PROTECTED]>
wrote:

>
> Geoff, could you please provide me with some additional information
> about the multistaging recipes? I can find the capistrano-ext package
> on rubyforge, but I don't see any documentation anywhere.


This is, sadly, true of most of Capistrano.

Reading through my own multistage config, I have this in config/deploy.rb:

set :default_stage, 'staging'
require 'capistrano/ext/multistage'

# Common config options here. You know the stuff:
set :application, 'myapp'
# ...

Then, create a folder called config/deploy. Put any stage-specific options
in there -- you'll probably have a config/deploy/staging.rb and
config/deploy/production.rb. These files must exist -- or rather, for every
stage, you must have a config/deploy/name_of_stage.rb file, even if it's
empty. Capistrano will read deploy.rb, and then deploy/whatever_stage.rb.

To run:

cap deploy                  # deploy to default, staging in my case
cap production deploy  # deploy to production

(Note: Nothing magical about "deploy" in the above -- it could be any task.)

I actually don't have anything in those files, as I've abstracted common
deploy options into a Rails plugin -- the default Capfile will grab anything
in a plugin's "recipes" directory. Multistage also sets a variable called
'stage' to a symbol defining that stage, so the plugin can do things like:

task :notify do
  if stage == :staging
    email_QA_team
  elsif stage == :production
    email_EVERYONE_OMG
  end
end
after 'deploy:update_code', :notify

Oh: I hereby release this email (except your quote) into the public domain,
in case anyone wants to put it on capify.org -- though it could probably ue
some cleaning up.

--~--~---------~--~----~------------~-------~--~----~
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/capistrano
-~----------~----~----~----~------~----~------~--~---

Reply via email to