Permalink
Browse files

Merge branch 'distribute-copy' of https://github.com/Viximo/capistrano

…into Viximo-distribute-copy
  • Loading branch information...
2 parents d799902 + e9aa712 commit cb70695f0067a8793488d7eaf9b37372f8648285 @leehambley leehambley committed Nov 15, 2010
Showing with 7 additions and 2 deletions.
  1. +7 −2 lib/capistrano/recipes/deploy/strategy/copy.rb
View
9 lib/capistrano/recipes/deploy/strategy/copy.rb
@@ -101,8 +101,7 @@ def deploy!
logger.trace "compressing #{destination} to #{filename}"
Dir.chdir(tmpdir) { system(compress(File.basename(destination), File.basename(filename)).join(" ")) }
- upload(filename, remote_filename)
- run "cd #{configuration[:releases_path]} && #{decompress(remote_filename).join(" ")} && rm #{remote_filename}"
+ distribute!
ensure
FileUtils.rm filename rescue nil
FileUtils.rm_rf destination rescue nil
@@ -211,6 +210,12 @@ def compress(directory, file)
def decompress(file)
compression.decompress_command + [file]
end
+
+ # Distributes the file to the remote servers
+ def distribute!
+ upload(filename, remote_filename)
+ run "cd #{configuration[:releases_path]} && #{decompress(remote_filename).join(" ")} && rm #{remote_filename}"
+ end
end
end

0 comments on commit cb70695

Please sign in to comment.