Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Allow specifying copy method

  • Loading branch information...
commit 62b8f7ad3858cf1a0abbaa84fe83f3763730822e 1 parent 312b373
@duien duien authored leehambley committed
Showing with 6 additions and 1 deletion.
  1. +6 −1 lib/capistrano/recipes/deploy/strategy/copy.rb
7 lib/capistrano/recipes/deploy/strategy/copy.rb
@@ -38,6 +38,10 @@ module Strategy
# :copy_compression, which must be one of :gzip, :bz2, or
# :zip, and which specifies how the source should be compressed for
# transmission to each host.
+ #
+ # It also supports the variable :copy_via, which must be one of :sftp or
+ # :scp, and which specifies the method used to transfer the compressed
+ # code to the remote server. It defaults to :sftp.
class Copy < Base
# Obtains a copy of the source code locally (via the #command method),
# compresses it to a single file, copies that file to all target
@@ -96,7 +100,8 @@ def deploy!
logger.trace "compressing #{destination} to #{filename}"
Dir.chdir(tmpdir) { system(compress(File.basename(destination), File.basename(filename)).join(" ")) }
- upload(filename, remote_filename)
+ upload(filename, remote_filename, {:via => configuration[:copy_via]})
+ # FIXED Allow specifying transfer mode
run "cd #{configuration[:releases_path]} && #{decompress(remote_filename).join(" ")} && rm #{remote_filename}"
FileUtils.rm filename rescue nil
Please sign in to comment.
Something went wrong with that request. Please try again.