http://rubyhitsquad.com/Vlad_the_Deployer.html
Inspired by Capistrano, just Rake.
- vlad, vlad-git
- rake-remote_task
http://rubyhitsquad.com/Vlad_the_Deployer.html
Inspired by Capistrano, just Rake.
require 'vlad/passenger' | |
set :application, 'myapp' | |
set :user, 'deploy' | |
set :domain, "#{user}@10.0.0.10" | |
set :deploy_to, '/home/deploy/production/myapp' | |
set :repository, 'git@github.com:yardstick/myapp.git' | |
set :web_command, "/etc/init.d/httpd" #redhat doesn't use apachectl | |
namespace :vlad do | |
desc "setup apache configuration (assuming I had permission)" | |
remote_task :symlink_apache do | |
# sudo "" - must have tty | |
run "ln -fs #{current_path}/config/000-myapp.conf /home/deploy/apache/sites-available/000-myapp.conf" | |
run "ln -fs /home/deploy/apache/sites-available/000-myapp.conf /home/deploy/apache/sites-enabled/000-myapp.conf" | |
end | |
desc "copy system files not in git to shared folder" | |
task :deploy_system do | |
sh "scp -r public/system/* #{domain}:#{shared_path}/system/" | |
end | |
end | |
desc "Full deployment cycle" | |
task "vlad:deploy" => %w[vlad:update vlad:start_app vlad:cleanup] |
require 'rake' | |
begin | |
require 'vlad' | |
Vlad.load :scm => :git, :app => nil # use git, don't use mongrel | |
rescue LoadError | |
# do nothing (vlad/vlad-git not requird on server, | |
# unfortunately this hides the error if vlad-git isn't installed locally) | |
end |