Multi-Environment Vlad the Easy Way
Published 2009-03-24 @ 14:58
Tagged rails, vlad
Here is the clean and easy way to do multiple environments in vlad. Here is my deploy.rb:
set :application, "proj"
set :repository, "https://subversion/proj/trunk"
task :beta do
set :domain, "localhost"
set :deploy_to, "/tmp/proj_beta"
end
task :dev do
set :domain, "localhost"
set :deploy_to, "/tmp/proj_dev"
end
task :prod do
set :domain, "localhost"
set :deploy_to, "/tmp/proj_prod"
end
By not specifying domain
or deploy_to
globally you force the use of an environment whenever you invoke a vlad task:
% rake vlad:debug | egrep "(domain|deploy_to):"
rake aborted!
Please specify the deploy path via the :deploy_to variable
Here is what it looks like with one of the three defined environments:
% rake beta vlad:debug | egrep "(domain|deploy_to):"
domain: localhost
deploy_to: /tmp/proj_beta
% rake dev vlad:debug | egrep "(domain|deploy_to):"
domain: localhost
deploy_to: /tmp/proj_dev
% rake prod vlad:debug | egrep "(domain|deploy_to):"
domain: localhost
deploy_to: /tmp/proj_prod