user3048402
user3048402

Reputation: 1369

Rails 4 capistrano deploy to multiple servers?

I have my app deployed on multiple servers and each have their own database. How do I deploy the app with "cap deploy production" to all servers?

This is my 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"

I would need capistrano to also deploy it to the following:

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"

Upvotes: 0

Views: 2882

Answers (1)

max kaplan
max kaplan

Reputation: 589

Try this in your production.rb

role :app, %w{s01.foo.com s02.foo.com}, user: 'root'
role :web, %w{s01.foo.com s02.foo.com}, user: 'root'

Upvotes: 1

Related Questions