Forum: Ruby on Rails capistrano: deploying production and staging to same database

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Aadfd4d3adf8ca3833cb65f84671fdd5?d=identicon&s=25 'John Merlino' via Ruby on Rails: Talk (Guest)
on 2014-05-01 08:51
(Received via mailing list)
I have the production and staging site on two different server ips. But
the
database, another server ip, is the same database used by both
production
and staging. When i set up the capistrano deploy task for both the
production and staging, should I keep the db role in deploy.rb like
this:

deploy.rb

role :db,  "database_ip", :primary => true


production.rb

role :web, "production_ip"
role :app, "production_ip"

staging.rb

role :web, "staging_ip"
role :app, "staging_ip"

Or should I do it this way:

production.rb

role :web, "production_ip"
role :app, "production_ip"

role :db,  "database_ip", :primary => true


staging.rb

role :web, "production_ip"
role :app, "production_ip"

role :db,  "database_ip", :primary => true
81b61875e41eaa58887543635d556fca?d=identicon&s=25 Frederick Cheung (Guest)
on 2014-05-01 19:22
(Received via mailing list)
On Thursday, May 1, 2014 7:50:36 AM UTC+1, John Merlino wrote:
>
> I have the production and staging site on two different server ips. But
> the database, another server ip, is the same database used by both
> production and staging. When i set up the capistrano deploy task for both
> the production and staging, should I keep the db role in deploy.rb like
> this:
>
>
You could either. It might be easier to understand though if all the
hosts
for a given stage are in the same file.

However, the :db role doesn't actually mean the database server itself -
it
means where should migrations be run from.

Fred
This topic is locked and can not be replied to.