Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 662
swilliams Avatar asked Oct 04 '11 16:10

swilliams


1 Answers

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...

like image 130
swilliams Avatar answered Oct 21 '22 20:10

swilliams