Skip to content

Instantly share code, notes, and snippets.

@gonzariosm
Created April 14, 2014 06:15
Show Gist options
  • Save gonzariosm/10620693 to your computer and use it in GitHub Desktop.
Save gonzariosm/10620693 to your computer and use it in GitHub Desktop.
namespace :deploy do
desc 'Restart application'
task :restart do
on roles(:app), in: :sequence, wait: 5 do
# Your restart mechanism here, for example:
execute :touch, release_path.join('tmp/restart.txt')
end
end
after :publishing, :restart
after :restart, :clear_cache do
on roles(:web), in: :groups, limit: 3, wait: 10 do
# Here we can do anything such as:
within release_path do
execute :rake, 'cache:clear'
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment