Skip to content

Writing your own tasks

guillermo edited this page Sep 14, 2010 · 4 revisions

Write your own tasks is as easy as writing rake tasks.

For example, to add support for rails migrations:


task "deploy:migrations" do
  deploy.run("cd #{deploy.deploy_to}/current && RAILS_ENV=production rake deploy")
end

task “deploy:migrate” => [“deploy:symlink”,“deploy:migrations”]

With the addition of rake-hooks you can write easily a task to restart passanger:


after "deploy" do
  deploy.run("touch #{deploy.deploy_to}/current/tmp/restart.txt")
end

You can see all the deploy methods in de Deploy reference or just see some Recipes

Clone this wiki locally