Skip to content

Instantly share code, notes, and snippets.

@thattommyhall
Created April 1, 2011 11:29
Show Gist options
  • Save thattommyhall/898017 to your computer and use it in GitHub Desktop.
Save thattommyhall/898017 to your computer and use it in GitHub Desktop.
Testing before/after in Cap
def method_in_deploy
puts "METHOD IN DEPLOY"
end
task :task_in_deploy do
puts "TASK IN DEPLOY"
end
task :do_before do
puts "BEFORE"
end
task :do_after do
puts "AFTER"
end
namespace :deploy do
method_in_deploy
task_in_deploy
task(:start) {}
task(:stop) {}
desc "Restart Application"
task :restart, :roles => :app, :except => { :no_release => true } do
run "touch #{current_path}/tmp/restart.txt"
end
end
before :deploy, :do_before
after :deploy, :do_after
@thattommyhall
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment