Hi, If someone wants to take on this request, I will graciously agree to pay for a good and elegant working solution (in beer or dollars aprox the equivalent of two cases)
For a bunch of identical applications running on virtual hosts on the
same machine
(apache and mod_rails)
some time ago Jamis suggested an approach along the lines of
task :install_1 do
set :deploy_to, "/home/rails/install_1/#{application}"
end
...
task :install_n do
set :deploy_to, "/home/rails/install_n/#{application}"
end
Which works fine,
but there's some manual job involved each time a new instance is added,
My need is to deploy to the array of virtual servers on the single
physical machine,
changing several things bases solely in the user => pass hash
given {:user_1 => db_pass_1, :user_2 => db_pass_2, :user_n =>
db_pass_n }.each do |user_x, pass_x|
Where data about the repository remains 'static' but
I need to set all the following accordingly for each user:
set deploy_to: "/home/#{user_x}/apps/#{application}"
set :app, "#{user_x}.my_domain.com"
set :web, "#{user_x}.my_domain.com"
set :db, "#{user_x}.my_domain.com"
plus then modify each of the conf/database.yml accordingly
like in
production:
adapter: mysql
encoding: utf8
database: #{user_x}_app_production
username: #{user_x}
password: #{pass_x}
and I'd like all of that to happen when I say
cap deploy:update
I would even give up to add,
cap deploy:configure_database
Thanks!
smime.p7s
Description: S/MIME cryptographic signature
