Rails 4 capistrano部署到多个服务器?

时间:2014-04-12 12:05:14

标签: ruby-on-rails capistrano

我的应用程序部署在多个服务器上,每个服务器都有自己的数据库。如何使用“cap deploy production”将应用程序部署到所有服务器?

这是我的 production.rb

role :web, "123.456.78.90"
role :app, "123.456.78.90"
role :db,  "123.456.78.90", :primary => true
set :rails_env, "production"
set :user, "root"
set :password, "password"

我需要capistrano将它部署到以下内容:

role :web, "567.890.12.34"
role :app, "567.890.12.34"
role :db,  "567.890.12.34", :primary => true
set :rails_env, "production"
set :user, "root"
set :password, "password"

1 个答案:

答案 0 :(得分:1)

production.rb

中尝试此操作
role :app, %w{s01.foo.com s02.foo.com}, user: 'root'
role :web, %w{s01.foo.com s02.foo.com}, user: 'root'