1
0
Fork 0
mirror of https://github.com/capistrano/capistrano synced 2023-03-27 23:21:18 -04:00

Merge pull request #758 from capistrano/fix/before-namespacing

Correctly infer namespace in task enhancements
This commit is contained in:
Tom Clements 2013-11-01 14:19:56 -07:00
commit c4ac9c896b
3 changed files with 6 additions and 3 deletions

View file

@ -6,9 +6,10 @@ module Capistrano
end
def after(task, post_task, *args, &block)
post_task = Rake::Task.define_task(post_task, *args, &block) if block_given?
Rake::Task.define_task(post_task, *args, &block) if block_given?
post_task = Rake::Task[post_task]
Rake::Task[task].enhance do
invoke(post_task)
post_task.invoke
end
end

View file

@ -200,6 +200,7 @@ namespace :deploy do
end
end
task :restart
task :failed
end

View file

@ -17,7 +17,6 @@ set :repo_url, 'git@example.com:me/my_repo.git'
# set :keep_releases, 5
namespace :deploy do
after :publishing, :restart
desc 'Restart application'
task :restart do
@ -27,6 +26,8 @@ namespace :deploy do
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: