Multi-Environment Vlad the Easy Way

| | Comments (1)

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

1 Comments

Leave a comment

About this Entry

This page contains a single entry by zenspider published on March 24, 2009 2:58 PM.

WANTED: 27 cute little puppies need new homes was the previous entry in this blog.

hoe version 1.12.0 has been released! is the next entry in this blog.

Find recent content on the main index or look in the archives to find all content.

Pages

Powered by Movable Type 4.32-en