我正在尝试将多级 capistrano 部署到我的生产和登台服务器。这是我的 deploy.rb
文件(省略 scm 详细信息):
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
而在
config/deploy/production.rb
:set :domain, "production.com"
set :user, "prod"
config/deploy/staging.rb
:set :domain, "shootsystage.com"
set :user, "stage"
没有什么异国情调的事情(我认为)。运行
cap production one:foo
工作正常。但是正在运行 cap staging one:foo
结果是:the task `staging' does not exist
这是怎么回事?
最佳答案
看起来像一小段语法咬了我的屁股。它应该是:
set :stages, %w{staging production}
请注意
%w{}
中缺少逗号.呜呜呜呜呜呜呜呜呜呜呜呜呜呜呜呜呜呜呜呜呜呜呜呜呜呜呜呜呜呜呜呜呜呜呜呜呜呜呜呜呜呜呜呜呜呜呜呜呜呜呜呜呜呜呜呜呜
关于deployment - Capistrano 无法识别多级舞台,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7650759/