swilliams
swilliams

Reputation: 48930

Capistrano not recognizing multistage stage

I'm trying to get a multistage capistrano deployment to my production and staging servers. Here's my deploy.rb file (scm details omitted):

require 'bundler/capistrano'
require 'whenever/capistrano'

set :application, "myapp"

set :stages, %w{staging, production}
set :default_stage, "staging"
require 'capistrano/ext/multistage'

set :deploy_to, "/webapps/myapp"

set(:domain) { "#{domain}" }
role(:web) { domain }
role(:app) { domain }
role(:db, :primary => true) { domain }

default_run_options[:pty] = true

namespace :one do
    task :foo do
        puts "foo"
    end
end

And in config/deploy/production.rb:

set :domain, "production.com"
set :user, "prod"

config/deploy/staging.rb:

set :domain, "shootsystage.com"
set :user, "stage"

Nothing too exotic going on (I think). Running cap production one:foo works fine. But running cap staging one:foo results in:

the task `staging' does not exist

What's going on?

Upvotes: 8

Views: 3865

Answers (1)

swilliams
swilliams

Reputation: 48930

Looks like a small piece of syntax bit me in the butt. It should be:

set :stages, %w{staging production}

Note the lack of commas in the %w{}. Ffffuuuuuuuuuuu...

Upvotes: 11

Related Questions