Renfield
This gem adds several interesting features to vlad the deployer
The name comes from Dracula’s servant, R. M. Renfield .
Installation
On your environment.rb
:
config.gem :renfield
Then execute rake gems:install
if needed.
The Renfield requires vlad – gems:install should install that one too.
You can also install renfield + dependencies manually by doing:
gem install renfield
Your lib/tasks/vlad.rake
must also include vlad. Like so:
begin require 'vlad' Vlad.load :app => :passenger rescue LoadError # do nothing raise "vlad didn't load!" end require 'renfield'
Additions:
Renfield includes:
Methods
- color generation for console messages:
red
,green
,yellow
,blue
,magenta
,cyan
. Example:puts red('hello')
will print a red “hello” message on the console. -
info
,warning
,error
. They are a fancy way of printing information messages, warnings and errors. Example:info 'dump done'
-
remote_rake
for executing a rake on the target server. Example:remote_rake 'db:drop'
will dorun "cd #{current_path}; rake RAILS_ENV='production' db:drop"
- rsync can be used to move folders/files across servers
Remote tasks
-
vlad:chown
does nothing yet. -
vlad:restart
doesrun "cd #{current_path}; touch tmp/restart.txt"
-
vlad:confirm
asks for a confirmation before continuing. Otherwise the rake is aborted. -
vlad:clean_migrate
executesrake db:reset db:migrate
on the target server -
vlad:maintenance:set
puts a “this site is undergoing maintenance” page on the site -
vlad:maintenance:remove
removes the maintenance page
That’s all for now.