Last active
August 29, 2015 13:57
-
-
Save vdaubry/9750386 to your computer and use it in GitHub Desktop.
deploy.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# config valid only for Capistrano 3.1 | |
lock '3.1.0' | |
set :application, 'my-app' | |
set :repo_url, '[email protected]: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