Skip to content

Instantly share code, notes, and snippets.

@atmos
Created October 19, 2008 19:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save atmos/17913 to your computer and use it in GitHub Desktop.
Save atmos/17913 to your computer and use it in GitHub Desktop.
# multi environment merb deployment with vlad and god
set :application, "ninja"
set :deploy_to, "/data/ninja"
set :code_repo, 'git@github.com:atmos/ninja.git'
set :revision, "origin/master"
set :user, "ey"
set :use_sudo, false
task :production do
role :app, 'eyYY-s00020'
role :app, 'eyYY-s00021'
set :deploy_host, 'eyYY-s00020'
set :merb_env, 'production'
end
task :staging do
role :app, 'eyXX-s00224'
set :deploy_host, 'eyXX-s00224'
set :merb_env, 'staging'
end
task :deploy => [ :define_roles, 'vlad:stop', 'vlad:update', 'vlad:symlink_configs', 'vlad:start']
task :long_deploy => [ :define_roles, 'vlad:stop', 'vlad:update', 'vlad:merb:symlink_configs', 'vlad:dm:migrate', 'vlad:start']
remote_task :tail, :roles => [:app] do
run "tail -n1000 -f #{current_path}/log/#{merb_env}.log"
end
task :define_roles do
raise "You have to specify an environment name 'rake production #{application}:deploy'" if merb_env.nil? or merb_env.empty?
role :web, deploy_host
role :db, deploy_host, :primary => true
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment