summaryrefslogtreecommitdiff
path: root/lib/chef/provider/deploy.rb
diff options
context:
space:
mode:
authordanielsdeleo <dan@opscode.com>2013-06-11 13:31:42 -0700
committerdanielsdeleo <dan@opscode.com>2013-06-12 19:44:17 -0700
commit0d6f062a077dace81b482bd624b5365b963a6d38 (patch)
tree60c92764ba7b88c6f257cc5502b5577979033e40 /lib/chef/provider/deploy.rb
parent83ad7d9aeb3f7c4b752dd92d4ca1f3671a0ab9ac (diff)
downloadchef-0d6f062a077dace81b482bd624b5365b963a6d38.tar.gz
attempt redeploy of failed deployment
`deploy_revision` provider now stores releases in the release history cache only after a successful deploy. As a result, a partially deployed application will be overwritten by a subsequent deploy to the same revision (similar to force_deploy). Fixes CHEF-2741
Diffstat (limited to 'lib/chef/provider/deploy.rb')
-rw-r--r--lib/chef/provider/deploy.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/chef/provider/deploy.rb b/lib/chef/provider/deploy.rb
index 2c915649a4..859a7da283 100644
--- a/lib/chef/provider/deploy.rb
+++ b/lib/chef/provider/deploy.rb
@@ -228,6 +228,10 @@ class Chef
end
def cleanup!
+ converge_by("update release history data") do
+ release_created(release_path)
+ end
+
chop = -1 - @new_resource.keep_releases
all_releases[0..chop].each do |old_release|
converge_by("remove old release #{old_release}") do
@@ -263,10 +267,10 @@ class Chef
def copy_cached_repo
target_dir_path = @new_resource.deploy_to + "/releases"
converge_by("deploy from repo to #{@target_dir_path} ") do
+ FileUtils.rm_rf(release_path) if ::File.exist?(release_path)
FileUtils.mkdir_p(target_dir_path)
FileUtils.cp_r(::File.join(@new_resource.destination, "."), release_path, :preserve => true)
Chef::Log.info "#{@new_resource} copied the cached checkout to #{release_path}"
- release_created(release_path)
end
end