Vlad
From Docunext Technology Wiki
I'm going to try out Vlad because it claims to be a very simple Ruby application deployment tool.
Contents |
Initial Setup
To use vlad, there needs to be a config folder with a deploy.rb file in it. Something like this:
config/deploy.rb
set :application, "project" set :domain, "example.com" set :deploy_to, "/path/to/install" set :repository, 'http://svn.example.com/project/branches/stable/'
Vlad and Git
Yay! After this:
** Invoke vlad:setup (first_time) ** Execute vlad:setup ** Invoke vlad:setup_app (first_time) rake aborted! Please specify the server domain via the :domain variable
japhr pointed out that vlad-git needed to be installed too. After:
sudo gem install vlad-git
it worked!
Running Vlad
I use vlad like this:
$ rake vlad:deploy (in /home/foobar/Documents/example.com) HEAD is now at cc3a5c5 rails 2.3.11 Switched to branch 'deployed-HEAD' /home/example/example.com/scm /home/example/example.com/scm Stopping httpd: [ OK ] httpd: Could not reliably determine the server's fully qualified domain name, using 192.168.30.83 for ServerName Starting httpd: [ OK ]
Makes Rake Rock
In some ways, Vlad is a way of using Rake, and that, combined with the colorful website presented by the Ruby Hit Squad, makes me smile.
For quite some time, I've relied upon dodgy shell scripts for running commands on remote machines. Thanks to Vlad, I can now see how they can be relegated to Rake, or Vlad for that matter, though obviously Vlad is focused on software application deployment.
Speaking of application deployment, how are Ruby applications usually run? I've run them as FastCGI processes in the past, but now I'm leaning towards a complete Rack stack, using NGINX and Varnish to reverse proxy right back to a raw Ruby HTTP web server like Mongrel, Thin, or Unicorn.
But how should those processes be managed? I'm thinking of something like Daemontools or Runit, like I've used for FastCGI applications that should run all the time.
John has a similar idea: http://johnleach.co.uk/words/archives/2007/04/08/262/daemontools-and-ruby-on-rails
I just followed John's instructions and they worked for me.
Vlad Restart Task for Daemontools
This is the Rake task I use with Regdel via Vlad:
namespace :vlad do
remote_task :restart do
run "sudo svc -d /service/regdel"
run "sudo svc -u /service/regdel"
end
end
Vlad Restart Task for Apache on CentOS
remote_task :restart do
run "sudo /sbin/service httpd restart"
end