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?
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...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With