omc 0.0.9 → 0.0.10

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: 05ac333f0451e2a68edda9fd7081a0763d1c9926
4
- data.tar.gz: 232653f29a7dd2899e976e4b30f90d5c532dd48e
3
+ metadata.gz: a12234410a3558793fd0673f911603c884868d9b
4
+ data.tar.gz: 4fa295dc5e03a8cb0d9e467d8015705e755fc333
5
5
  SHA512:
6
- metadata.gz: cba81e8dc716ab5acba20e33e7e661213a1b655b8651c8f3a108fcbaebf41630ad67b4d0d6a7c21facbf1d62adc149dcc03c02177c9e597a42874ab8c3078b7b
7
- data.tar.gz: 6261c3311a56c8fd3628a761898d0ac9d8e89553eca79cc9633992c7aadcbab52f76f314c6968fac2b766add013f56a9ae603ec82d8e8157404663be5d6e03f5
6
+ metadata.gz: ac2dd7f0c7941c1754bab87607beeddf29b810d8fcf2ee044d850a661e32e810a9406fb6c3ba09ccb3310e90ad0ff13f811a39ff784879309e2c933c520f7a32
7
+ data.tar.gz: f7ccd20daccbd25be303c48044f1f512b089acf2b1cb9b236d88b7008b1aed92d007861f0fc1b8872b3ff25a7f8225acf34c1c08d79334f9507dd62bdbb8eb42
data/README.md CHANGED
@@ -34,3 +34,11 @@ secret = "abcd1234"
34
34
  ```
35
35
  omc help
36
36
  ```
37
+
38
+ Accepted ssh options:
39
+ ```
40
+ -R 3000:localhost:3001 # Forwards port 3000 on the remote host to port 3001 on the localhost
41
+ -A # Forward agent
42
+ ```
43
+
44
+ Please the the ssh help for more detail.
@@ -9,6 +9,7 @@ module Omc
9
9
  class_option :account, aliases: '-a'
10
10
  class_option :layer, aliases: '-l'
11
11
  class_option :forward_agent, aliases: "-A", type: :boolean, default: false
12
+ class_option :remote_forward, aliases: "-R", type: :string, default: nil
12
13
 
13
14
  desc 'ssh STACK', 'Connect to an instance on a stack on an account'
14
15
  def ssh(stack)
@@ -17,7 +18,8 @@ module Omc
17
18
  user,
18
19
  stack,
19
20
  layer: options[:layer],
20
- forward_agent: options[:forward_agent]
21
+ forward_agent: options[:forward_agent],
22
+ remote_forward: options[:remote_forward]
21
23
  )
22
24
  command.ssh
23
25
  end
@@ -3,13 +3,14 @@ require 'omc/account'
3
3
 
4
4
  module Omc
5
5
  class StackCommand
6
- def initialize aws_account, user, stack_name, app: nil, layer: nil, forward_agent: false
6
+ def initialize aws_account, user, stack_name, app: nil, layer: nil, forward_agent: false, remote_forward: nil
7
7
  @aws_account = aws_account
8
8
  @user = user
9
9
  @stack_name = stack_name
10
10
  @app_name = app
11
11
  @layer_name = layer
12
12
  @forward_agent = forward_agent
13
+ @remote_forward = remote_forward
13
14
  end
14
15
 
15
16
  def ssh
@@ -100,8 +101,13 @@ module Omc
100
101
 
101
102
  def default_ssh_args
102
103
  [].tap do |args|
103
- args.push("-o", "ProxyCommand ssh -W %h:%p #{bastion.host}") if bastion
104
+ if (bastion)
105
+ proxy_command = "ProxyCommand ssh -W %h:%p #{bastion.host}"
106
+ proxy_command += " -R #{@remote_forward}" if @remote_forward
107
+ args.push("-o", proxy_command)
108
+ end
104
109
  args.push("-A") if @forward_agent
110
+ args.push("-R #{@remote_forward}") if @remote_forward
105
111
  end
106
112
  end
107
113
 
@@ -1,3 +1,3 @@
1
1
  module Omc
2
- VERSION = '0.0.9'
2
+ VERSION = '0.0.10'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omc
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.9
4
+ version: 0.0.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Clarke Brunsdon
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-04-27 00:00:00.000000000 Z
11
+ date: 2017-02-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor