Class: Xcode::Deploy::Ssh
- Inherits:
-
Object
- Object
- Xcode::Deploy::Ssh
- Defined in:
- lib/xcode/deploy/ssh.rb
Instance Attribute Summary collapse
-
#dir ⇒ Object
Returns the value of attribute dir.
-
#host ⇒ Object
Returns the value of attribute host.
-
#password ⇒ Object
Returns the value of attribute password.
-
#username ⇒ Object
Returns the value of attribute username.
Instance Method Summary collapse
- #deploy ⇒ Object
-
#initialize(builder, options) ⇒ Ssh
constructor
A new instance of Ssh.
- #remote_installation_path ⇒ Object
Constructor Details
#initialize(builder, options) ⇒ Ssh
Returns a new instance of Ssh.
10 11 12 13 14 15 16 17 |
# File 'lib/xcode/deploy/ssh.rb', line 10 def initialize(builder, ) @builder = builder @username = [:username] @password = [:password] @dir = [:dir] @host = [:host] @base_url = [:base_url] end |
Instance Attribute Details
#dir ⇒ Object
Returns the value of attribute dir.
8 9 10 |
# File 'lib/xcode/deploy/ssh.rb', line 8 def dir @dir end |
#host ⇒ Object
Returns the value of attribute host.
8 9 10 |
# File 'lib/xcode/deploy/ssh.rb', line 8 def host @host end |
#password ⇒ Object
Returns the value of attribute password.
8 9 10 |
# File 'lib/xcode/deploy/ssh.rb', line 8 def password @password end |
#username ⇒ Object
Returns the value of attribute username.
8 9 10 |
# File 'lib/xcode/deploy/ssh.rb', line 8 def username @username end |
Instance Method Details
#deploy ⇒ Object
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/xcode/deploy/ssh.rb', line 23 def deploy WebAssets.generate @builder, @base_url do |dist_path| puts "Copying files to #{@remote_host}:#{remote_installation_path}" Net::SSH.start(@host, @username, :password => @password) do |ssh| puts "Creating folder with mkdir #{remote_installation_path}" ssh.exec!("mkdir #{remote_installation_path}") end Net::SCP.start(@host, @username, :password => @password) do |scp| puts "Copying files from folder #{dist_path}" Dir["#{dist_path}/*"].each do |f| puts "Copying #{f} to remote host in folder #{remote_installation_path}" scp.upload! "#{f}", "#{remote_installation_path}" end scp.upload! "#{@options[:ipa_path]}", "#{remote_installation_path}" end end end |
#remote_installation_path ⇒ Object
19 20 21 |
# File 'lib/xcode/deploy/ssh.rb', line 19 def remote_installation_path File.join(@dir, @builder.product_name) end |