Skip to content
This repository
Browse code

Allow specifying copy method

  • Loading branch information...
commit 62b8f7ad3858cf1a0abbaa84fe83f3763730822e 1 parent 312b373
Emily Hyland duien authored leehambley committed

Showing 1 changed file with 6 additions and 1 deletion. Show diff stats Hide diff stats

  1. +6 1 lib/capistrano/recipes/deploy/strategy/copy.rb
7 lib/capistrano/recipes/deploy/strategy/copy.rb
@@ -38,6 +38,10 @@ module Strategy
38 38 # :copy_compression, which must be one of :gzip, :bz2, or
39 39 # :zip, and which specifies how the source should be compressed for
40 40 # transmission to each host.
  41 + #
  42 + # It also supports the variable :copy_via, which must be one of :sftp or
  43 + # :scp, and which specifies the method used to transfer the compressed
  44 + # code to the remote server. It defaults to :sftp.
41 45 class Copy < Base
42 46 # Obtains a copy of the source code locally (via the #command method),
43 47 # compresses it to a single file, copies that file to all target
@@ -96,7 +100,8 @@ def deploy!
96 100 logger.trace "compressing #{destination} to #{filename}"
97 101 Dir.chdir(tmpdir) { system(compress(File.basename(destination), File.basename(filename)).join(" ")) }
98 102
99   - upload(filename, remote_filename)
  103 + upload(filename, remote_filename, {:via => configuration[:copy_via]})
  104 + # FIXED Allow specifying transfer mode
100 105 run "cd #{configuration[:releases_path]} && #{decompress(remote_filename).join(" ")} && rm #{remote_filename}"
101 106 ensure
102 107 FileUtils.rm filename rescue nil

0 comments on commit 62b8f7a

Please sign in to comment.
Something went wrong with that request. Please try again.