capistrano / sshkit

A toolkit for deploying code and assets to servers in a repeatable, testable, reliable way.
MIT License
1.15k stars 253 forks source link

Allow SFTP to be used for upload!/download! instead of SCP #524

Closed mattbrictson closed 9 months ago

mattbrictson commented 9 months ago

SSHKit can now use SFTP for file transfers. The default is still SCP, but this can be changed to SFTP per host:

host = SSHKit::Host.new('user@example.com')
host.transfer_method = :sftp

or globally:

SSHKit::Backend::Netssh.configure do |ssh|
  ssh.transfer_method = :sftp
end

Fixes #15

mattbrictson commented 9 months ago

@JasonPoll this PR is still a work in progress, but it should be ready for you to test. Let me know if this branch works with SFTP in your environment. Also would appreciate any suggestions/feedback on the implementation. Thanks!

mattbrictson commented 9 months ago

Thanks @JasonPoll and @will-in-wi for the reviews! I plan on releasing this as part of sshkit 1.22.0 in mid-January, after 1.21.7 has some time in the wild. In the meantime, you can take advantage of the new sftp functionality by pointing your Gemfile at the master branch:

gem "sshkit", github: "capistrano/sshkit", branch: "master"