1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00

added scp support

This commit is contained in:
Allan 2011-02-25 08:43:12 +08:00 committed by Wesley Beary
parent de7a6b0564
commit 9c0823bfa5
4 changed files with 32 additions and 0 deletions

View file

@ -119,6 +119,14 @@ module Fog
Fog::SSH.new(ips.first['address'], username, options).run(commands) Fog::SSH.new(ips.first['address'], username, options).run(commands)
end end
def scp(local_path, remote_path)
requires :ips, :username
options = {}
options[:key_data] = [private_key] if private_key
Fog::SCP.new(ips.first['address'], username, options).upload(local_path, remote_path)
end
def username def username
@username ||= 'deploy' @username ||= 'deploy'
end end

View file

@ -77,6 +77,14 @@ module Fog
Fog::SSH.new(ip['ip'], username, options).run(commands) Fog::SSH.new(ip['ip'], username, options).run(commands)
end end
def scp(local_path, remote_path)
requires :ip, :username
options = {}
options[:key_data] = [private_key] if private_key
Fog::SCP.new(ip['ip'], username, options).upload(local_path, remote_path)
end
def setup(credentials = {}) def setup(credentials = {})
requires :ip, :identity, :public_key, :username requires :ip, :identity, :public_key, :username
Fog::SSH.new(ip['ip'], username, credentials).run([ Fog::SSH.new(ip['ip'], username, credentials).run([

View file

@ -119,6 +119,14 @@ module Fog
Fog::SSH.new(addresses['public'].first, username, options).run(commands) Fog::SSH.new(addresses['public'].first, username, options).run(commands)
end end
def scp(local_path, remote_path)
requires :addresses, :username
options = {}
options[:key_data] = [private_key] if private_key
Fog::SCP.new(addresses['public'].first, username, options).upload(local_path, remote_path)
end
def username def username
@username ||= 'root' @username ||= 'root'
end end

View file

@ -109,6 +109,14 @@ module Fog
Fog::SSH.new(addresses.first, username, options).run(commands) Fog::SSH.new(addresses.first, username, options).run(commands)
end end
def scp(local_path, remote_path)
requires :addresses, :username
options = {}
options[:key_data] = [private_key] if private_key
Fog::SCP.new(addresses.first, username, options).upload(local_path, remote_path)
end
def username def username
@username ||= 'root' @username ||= 'root'
end end