Trying out Vlad the Deployer
on January 26, 2008 @ 09:09 PM
This blog wasn’t using any form of automated deployment until late last night. For the longest time rsync and ssh seemed to be adequate enough even though I’m familiar with Capistrano and had been well aware of Vlad the Deployer’s release. Since I know about Capistrano I decided to invest some time getting to know Vlad.
This site is currently running on a 0.7.3 Mephisto installation with a custom theme by yours truly and it’s hosted on Dreamhost servers. Out of the box Vlad works with mongrel+apache+svn. Unfortunately Dreamhost uses apache+fastcgi, but thankfully tweaking Vlad was a piece of cake.
I followed the instructions on the examples page for Vlad, but ultimately found I needed to do a little tweaking for my environment. Based on those basic examples I ended up making the following changes to my Rakefile and deploy.rb recipe file.
Here’s what I appended to my Rakefile:
1 2 3 |
# appended to my Rakefile require 'vlad' Vlad.load(:app => :apache) |
Here’s my config/deploy.rb file:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
set :domain, "continuousthinking.com" set :deploy_to, "/my/path/to/continuousthinking.com/" set :repository, "http://myserver/svn/continuousthinking.com/trunk" set :web_command, "echo skipping web " namespace :vlad do remote_task :start_app do run "pkill -f dispatch.fcgi" fork do puts "sending a request to the domain so dispatchers restart" `wget http://#{domain} -O /dev/null` end end remote_task :update do Rake::Task['vlad:after_update'].invoke end remote_task :after_update do run "ln -s #{deploy_to}/shared/system/database.yml #{deploy_to}/current/config/database.yml" run "rm -f /home/zdennis/continuousthinking.com && ln -s #{deploy_to}/current /home/zdennis/continuousthinking.com" end remote_task :deploy => [:update, :start_app] end |
I overrode the :web_command setting so Vlad didn’t try to restart apache. The other tasks were added to customize specific needs for the deployment of the blog:
- :start_app – kill all of dispatchers on Dreamhost and then send a request to have Dreamhost launch new ones
- :update – adds this task to the :update task call chain. This simulates an after_update.
- :after_update – create symlinks, etc to be performed after code has been updated.
- :deploy – update code and restart the app
Overall, it was a pleasant process. I give Vlad a +1.


0 comments
Jump to comment form | comments rss [?]