Skip to content

Instantly share code, notes, and snippets.

@vdaubry vdaubry/gist:9750386
Last active Aug 29, 2015

Embed
What would you like to do?
deploy.rb
# config valid only for Capistrano 3.1
lock '3.1.0'
set :application, 'my-app'
set :repo_url, 'git@github.com:my-app.git'
# Default deploy_to directory is /var/www/my_app
set :deploy_to, '/srv/www/my-app'
set :rvm_ruby_string, :local # use the same ruby as used locally for deployment
namespace :deploy do
desc 'Restart application'
task :restart do
on roles(:app), in: :sequence, wait: 5 do
execute "mkdir -p #{release_path.join('tmp')}"
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
You can’t perform that action at this time.