ec2-ssh 1.0.5 → 1.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8168af1501cc0643e43963625e266952a5172fe7
4
- data.tar.gz: 91e9b473285a1e34bff1f146406ffe15a23311f6
3
+ metadata.gz: 30ebd411bd39993aa0375b74cfdeddd0c8320b14
4
+ data.tar.gz: 1a6e3704a9c57f0a5bc5c8aca455f8b4662faba6
5
5
  SHA512:
6
- metadata.gz: 3e939f79353b3e65ea1aa154deae31c40a9b03d6885f8eb77663f25c279bc2b3b17b829da68acc9a4207bfaf09bdb77839304dc64f8f7af7f0dd218f3af52590
7
- data.tar.gz: dbdb11cc3686aa6f1f1833570bd08edcb79a6afb60365bfa86f668725bdbd36f3e64f083819eadc70aea8e47999bee3ea1eafddba4f758cdf43f237542c4aafb
6
+ metadata.gz: fa1d38276a5e2dceb6d3f02a2399ad76abaa2601effc09caac196266c4bf717dc5a24aa6352b50946e0e889f83ea668bb20c9ebb3f6386b2b5eb1e3a1a22f220
7
+ data.tar.gz: 19d8aa349f32b64ec61ce1ddc45ec7eaf80e05c6deed939320feef614d30008dce589c17d4b0d05875e75340a5926534514b06911cf2a1737ed6dc283ba227f8
@@ -1,5 +1,5 @@
1
1
  module Ec2Ssh
2
- VERSION = "1.0.5"
2
+ VERSION = "1.0.6"
3
3
  ABOUT = "ec2-ssh v#{VERSION} (c) #{Time.now.strftime("2015-%Y")} @innovia"
4
4
 
5
5
  $:.unshift File.expand_path(File.join(File.dirname(__FILE__), %w[.. lib]))
@@ -31,6 +31,9 @@ class Ec2Ssh::Cli < Thor
31
31
  method_option :tag_value, :desc => 'tag value to filter instances by'
32
32
  method_option :terminal, :aliases => 't', :desc => 'open terminal tabs for all servers'
33
33
  method_option :capture_output, :aliases => 'c', :desc => 'capture output'
34
+ method_option :upload, :desc => 'upload a file - source,destination (make sure seperate these by comma)', :banner => 'source,destination'
35
+ method_option :download, :desc => 'download a file - source,destination (make sure seperate these by comma)', :banner => 'source,destination'
36
+
34
37
  def connect
35
38
  extend Aws
36
39
  extend Ssh
@@ -68,7 +71,7 @@ class Ec2Ssh::Cli < Thor
68
71
  dsl_options[:limit] = options[:groups_limit] if options[:groups_limit]
69
72
 
70
73
  say "dsl opts: #{dsl_options}", color = :cyan
71
- ssh_to(options[:user], dsl_options, options[:cmd], options[:capture_output])
74
+ ssh_to(options[:user], dsl_options, options[:cmd], options[:capture_output], options[:upload], options[:download])
72
75
  end
73
76
  end
74
77
 
@@ -12,12 +12,29 @@ module Ec2Ssh::Cli::Ssh
12
12
  }
13
13
  end
14
14
 
15
- def ssh_to(user, dsl_options, cmd, capture_output)
15
+ def ssh_to(user, dsl_options, cmd, capture_output, upload, download)
16
16
  say "Running #{cmd} via ssh in #{dsl_options}", color = :cyan
17
17
  on @all_servers, dsl_options do |host|
18
- if capture_output
18
+
19
+ if upload
20
+ file = upload.split(',').map { |e| e.strip }
21
+ source = File.expand_path(file.first)
22
+ destination = file.last
23
+ puts "uploading #{source} to #{destination}..."
24
+ upload! source, destination
25
+ end
26
+
27
+ if download
28
+ file = download.split(',').map { |e| e.strip }
29
+ source = file.first
30
+ destination = File.expand_path(file.last)
31
+ puts "downloading #{source} to #{destination}..."
32
+ download! source, destination
33
+ end
34
+
35
+ if capture_output
19
36
  puts capture cmd
20
- else
37
+ elsif upload.nil? && download.nil?
21
38
  execute cmd
22
39
  end
23
40
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ec2-ssh
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.5
4
+ version: 1.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ami Mahloof