diff --git a/deploy/recipes/web-rollback.rb b/deploy/recipes/web-rollback.rb new file mode 100644 index 0000000000..a48b250e2a --- /dev/null +++ b/deploy/recipes/web-rollback.rb @@ -0,0 +1,16 @@ +# +# Cookbook Name:: rollback +# Recipe:: web +# + +node[:deploy].each do |application, deploy| + deploy deploy[:deploy_to] do + user deploy[:user] + action 'rollback' + restart_command "sleep #{deploy[:sleep_before_restart]} && #{deploy[:restart_command]}" + + only_if do + File.exists?(deploy[:current_path]) + end + end +end