views:

19

answers:

1

I just tried to run

cap deploy:setup

on the command line, but it wanted it to run on just one particular server instead of them all. Is there a way to run a task on just one server from the command line, or do I have to define it that way in the deploy.rb file?

+1  A: 

Are you using capistrano-multistage? If not I recommend you do, I believe you can achieve the same with just the deploy.rb but personally I just find it easier this way and it makes this process much neater, especially if you start doing different things in production, staging or other stages.

Basically once you've installed the gem locally you can simply run commands like this:

cap staging deploy:setup 

Where the 'staging' part matches one of you stage files (See below).

To get up and running change deploy.rb to something like this:

set :stages, %w(staging production)
set :default_stage, "staging"
require 'capistrano/ext/multistage'
after "deploy", "deploy:cleanup"

Then add a folder named deploy into the config directory of your rails app. In there you can place your separate deployment files, e.g staging.rb and production.rb.

tsdbrown