From c26dc5cdcb01c7e2123b7e12fcbdc5652c459c2d Mon Sep 17 00:00:00 2001 From: Geoff Gravitate Date: Wed, 6 Jan 2016 04:05:58 -0800 Subject: [PATCH] Create php-rollback.rb Added Missing Rollback for php-apps --- deploy/recipes/php-rollback.rb | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 deploy/recipes/php-rollback.rb diff --git a/deploy/recipes/php-rollback.rb b/deploy/recipes/php-rollback.rb new file mode 100644 index 0000000000..397ce05ca7 --- /dev/null +++ b/deploy/recipes/php-rollback.rb @@ -0,0 +1,16 @@ +# +# Cookbook Name:: rollback +# Recipe:: php +# + +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