tugboat 1.0.0 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8ae578da8803eb53d3b66af1565cde4be593b2ea
4
- data.tar.gz: cf7ee510146edd0c175977a948614ace35708bf7
3
+ metadata.gz: f30609ec594ea66af927054753773df577581965
4
+ data.tar.gz: 8c3a0372b25f175eb12cd372edb8f518fa36fb8c
5
5
  SHA512:
6
- metadata.gz: 187a3f8992f56d41067988fb5091cf3879cf80064482fb1f75006daa11bcf078f081a6f7ec7cbcb3b6c44befe8ed09f12e2bf0a5967fc45e03e2fe9938752fc3
7
- data.tar.gz: 0cee5b5abfd7ec9eaa00308dc1e38fae7132edd0187fa7a6a4b2bfa1bdb6c1909c81f9f959f06cc4796c9cca36a049f8381fbc939d03cbd955cd5a29a470138f
6
+ metadata.gz: 6a288744e5b47ccdc56a23eff3c9bf3a2bb13a0b631a0a3948c35cd4217600e9db0da6690ab9ba21c2506ca6e55148823ef5764d5968aa6766b31ee1519285c0
7
+ data.tar.gz: 898efe785343d19d4827b36bc098dfc6136187db488231e031e6d51a966ec1eda8e78872aa7d4f4d307f5c56e9e6bec0c30d18b218de52abcc784a76a2392168
@@ -2,7 +2,27 @@
2
2
 
3
3
  ## [Unreleased](https://github.com/pearkes/tugboat/tree/HEAD)
4
4
 
5
- [Full Changelog](https://github.com/pearkes/tugboat/compare/v0.2.0...HEAD)
5
+ [Full Changelog](https://github.com/pearkes/tugboat/compare/v1.1.0...HEAD)
6
+
7
+ **Fixed bugs:**
8
+
9
+ - SSH to Private IP [\#169](https://github.com/pearkes/tugboat/issues/169)
10
+
11
+ **Closed issues:**
12
+
13
+ - Unable to bundle to run tugboat from git repo version for testing [\#171](https://github.com/pearkes/tugboat/issues/171)
14
+
15
+ **Merged pull requests:**
16
+
17
+ - Update ssh to private ip [\#172](https://github.com/pearkes/tugboat/pull/172) ([petems](https://github.com/petems))
18
+
19
+ **Closed issues:**
20
+
21
+ - 1.0.0 Release [\#125](https://github.com/pearkes/tugboat/issues/125)
22
+
23
+ ## [v1.0.0](https://github.com/pearkes/tugboat/tree/v1.0.0) (2015-05-26)
24
+
25
+ [Full Changelog](https://github.com/pearkes/tugboat/compare/v0.2.0...v1.0.0)
6
26
 
7
27
  **Implemented enhancements:**
8
28
 
data/Gemfile CHANGED
@@ -5,6 +5,6 @@ gemspec
5
5
 
6
6
  group :development do
7
7
  # Random order is not in the Aruba Cucumber yet...
8
- gem 'cucumber', git: 'https://github.com/cucumber/cucumber.git', tag: 'v2.0.0.beta.2'
9
- gem 'cucumber-core', git: 'https://github.com/cucumber/cucumber-core.git', tag: 'v1.0.0.beta.2'
8
+ gem 'cucumber', git: 'https://github.com/cucumber/cucumber-ruby.git', tag: 'v2.0.2'
9
+ gem 'cucumber-core', git: 'https://github.com/cucumber/cucumber-ruby-core.git', tag: 'v1.2.0'
10
10
  end
@@ -99,10 +99,10 @@ module Tugboat
99
99
  :type => :string,
100
100
  :aliases => "-p",
101
101
  :desc => "The custom SSH Port to connect to"
102
- method_option "use_public_ip",
102
+ method_option "use_private_ip",
103
103
  :type => :boolean,
104
- :aliases => "-e",
105
- :desc => "Use public IP while private IP is present"
104
+ :aliases => "-t",
105
+ :desc => "Use Private IP while private IP is present"
106
106
  method_option "ssh_user",
107
107
  :type => :string,
108
108
  :aliases => "-u",
@@ -122,7 +122,7 @@ module Tugboat
122
122
  "user_droplet_fuzzy_name" => name,
123
123
  "user_droplet_ssh_port" => options[:ssh_port],
124
124
  "user_droplet_ssh_user" => options[:ssh_user],
125
- "user_droplet_use_public_ip" => options[:use_public_ip],
125
+ "user_droplet_use_private_ip" => options[:use_public_ip],
126
126
  "user_droplet_ssh_opts" => options[:ssh_opts],
127
127
  "user_droplet_ssh_command" => options[:ssh_command],
128
128
  "user_quiet" => options[:quiet]
@@ -27,14 +27,15 @@ module Tugboat
27
27
 
28
28
  host_ip = env["droplet_ip"]
29
29
 
30
- if env["droplet_ip_private"]
31
- use_public_ip = env["config"].use_public_ip
32
-
33
- if not env["user_droplet_use_public_ip"].nil?
34
- use_public_ip = env["user_droplet_use_public_ip"]
35
- end
30
+ if env["user_droplet_use_private_ip"] && env["droplet_ip_private"].nil?
31
+ say "You asked to ssh to the private IP, but no Private IP found!", :red
32
+ exit 1
33
+ end
36
34
 
37
- if not use_public_ip
35
+ if env["droplet_ip_private"]
36
+ say "This droplet has a private IP, checking if you asked to use the Private IP..."
37
+ if env["user_droplet_use_private_ip"]
38
+ say "You did! Using private IP for ssh..."
38
39
  host_ip = env["droplet_ip_private"]
39
40
  end
40
41
  end
@@ -1,3 +1,3 @@
1
1
  module Tugboat
2
- VERSION = "1.0.0"
2
+ VERSION = "1.1.0"
3
3
  end
@@ -17,10 +17,9 @@ describe Tugboat::Middleware::SSHDroplet do
17
17
  "-o", "UserKnownHostsFile=/dev/null",
18
18
  "-i", File.expand_path(ssh_key_path),
19
19
  "-p", ssh_port,
20
- "#{ssh_user}@#{droplet_ip_private}")
20
+ "#{ssh_user}@#{droplet_ip}")
21
21
 
22
22
  env["droplet_ip"] = droplet_ip
23
- env["droplet_ip_private"] = droplet_ip_private
24
23
  env["config"] = config
25
24
 
26
25
  described_class.new(app).call(env)
@@ -50,9 +49,7 @@ describe Tugboat::Middleware::SSHDroplet do
50
49
  described_class.new(app).call(env)
51
50
  end
52
51
 
53
- it "executes ssh using public ip setting from config" do
54
- config.data["use_public_ip"] = true
55
-
52
+ it "executes ssh with private IP if option chosen" do
56
53
  expect(Kernel).to receive(:exec).with("ssh",
57
54
  "-o", "IdentitiesOnly=yes",
58
55
  "-o", "LogLevel=ERROR",
@@ -60,15 +57,37 @@ describe Tugboat::Middleware::SSHDroplet do
60
57
  "-o", "UserKnownHostsFile=/dev/null",
61
58
  "-i", File.expand_path(ssh_key_path),
62
59
  "-p", ssh_port,
63
- "#{ssh_user}@#{droplet_ip}")
60
+ "-e",
61
+ "-q",
62
+ "-X",
63
+ "#{ssh_user}@#{droplet_ip_private}",
64
+ "echo hello")
64
65
 
65
66
  env["droplet_ip"] = droplet_ip
66
67
  env["droplet_ip_private"] = droplet_ip_private
67
68
  env["config"] = config
69
+ env["user_droplet_ssh_command"] = "echo hello"
70
+ env["user_droplet_use_private_ip"] = true
71
+ env["user_droplet_ssh_opts"] = "-e -q -X"
68
72
 
69
73
  described_class.new(app).call(env)
70
74
  end
71
75
 
76
+ it "errors if private IP option given but no Private IP on Droplet" do
77
+ env["droplet_ip"] = droplet_ip
78
+ env["config"] = config
79
+ env["user_droplet_ssh_command"] = "echo hello"
80
+ env["user_droplet_use_private_ip"] = true
81
+ env["user_droplet_ssh_opts"] = "-e -q -X"
82
+
83
+ expect {described_class.new(app).call(env)}.to raise_error(SystemExit)
84
+
85
+ expect($stdout.string).to eq <<-eos
86
+ Executing SSH ...
87
+ You asked to ssh to the private IP, but no Private IP found!
88
+ eos
89
+ end
90
+
72
91
  end
73
92
 
74
93
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tugboat
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jack Pearkes
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-05-26 00:00:00.000000000 Z
11
+ date: 2015-07-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor
@@ -286,7 +286,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
286
286
  version: '0'
287
287
  requirements: []
288
288
  rubyforge_project:
289
- rubygems_version: 2.4.6
289
+ rubygems_version: 2.4.8
290
290
  signing_key:
291
291
  specification_version: 4
292
292
  summary: A command line tool for interacting with your DigitalOcean droplets.