tugboat 2.2.0 → 2.2.1
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 +4 -4
- data/CHANGELOG.md +25 -1
- data/README.md +23 -1
- data/features/cassettes/config/Array_of_SSH_Keys_in_Config.yml +68 -0
- data/features/step_definitions/steps.rb +6 -0
- data/features/support/env.rb +33 -2
- data/features/tugboat/config_array_of_ssh_keys.feature +28 -0
- data/features/tugboat/config_current_directory.feature +12 -10
- data/lib/tugboat/middleware/create_droplet.rb +5 -4
- data/lib/tugboat/version.rb +1 -1
- data/tugboat.gemspec +2 -1
- metadata +24 -6
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 191f8c580acdb8df43570f84c9c5874e13012eb7
|
|
4
|
+
data.tar.gz: 924a5452cc0ee37b4b884468e2d89c2df15adbe2
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 7b9e6ee471a18dc45eb233798c7e4b123b862a1527b57a313efa52c5b7fab5fd8c8e68e2847e22445f1d2975b0c9dda54499af126266404552e055cb99a3719a
|
|
7
|
+
data.tar.gz: 5952037dadf29db13e4893de10e7ea9537a0952afe9729204d1226b882e82cdcb0573bcb7c98c7373dfcc743dd5b5846e405790420bbe47b4589aa9b681ea825
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,29 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
|
+
## [v2.2.0](https://github.com/pearkes/tugboat/tree/v2.2.0) (2016-01-30)
|
|
4
|
+
|
|
5
|
+
[Full Changelog](https://github.com/pearkes/tugboat/compare/v2.1.0...v2.2.0)
|
|
6
|
+
|
|
7
|
+
**Merged pull requests:**
|
|
8
|
+
|
|
9
|
+
- Configuration support for IPv6 [\#233](https://github.com/pearkes/tugboat/pull/233) ([petems](https://github.com/petems))
|
|
10
|
+
|
|
11
|
+
- Add Regions to info\_image [\#232](https://github.com/pearkes/tugboat/pull/232) ([bmamlin](https://github.com/bmamlin))
|
|
12
|
+
|
|
13
|
+
- Install dependencies locally when developing [\#231](https://github.com/pearkes/tugboat/pull/231) ([else](https://github.com/else))
|
|
14
|
+
|
|
15
|
+
- Adds simplecov-console for terminal coverage info [\#229](https://github.com/pearkes/tugboat/pull/229) ([petems](https://github.com/petems))
|
|
16
|
+
|
|
17
|
+
- Updated simplecov's Multiple Formatters definition [\#228](https://github.com/pearkes/tugboat/pull/228) ([jasnow](https://github.com/jasnow))
|
|
18
|
+
|
|
19
|
+
- Add Bundler.require\(:development\) for default rake tasks [\#227](https://github.com/pearkes/tugboat/pull/227) ([andrehjr](https://github.com/andrehjr))
|
|
20
|
+
|
|
21
|
+
- Add debug logging [\#226](https://github.com/pearkes/tugboat/pull/226) ([petems](https://github.com/petems))
|
|
22
|
+
|
|
23
|
+
- Refactor the response.success? into helper [\#225](https://github.com/pearkes/tugboat/pull/225) ([petems](https://github.com/petems))
|
|
24
|
+
|
|
25
|
+
- Improves wait spec to actually perform wait [\#224](https://github.com/pearkes/tugboat/pull/224) ([petems](https://github.com/petems))
|
|
26
|
+
|
|
3
27
|
## [v2.1.0](https://github.com/pearkes/tugboat/tree/v2.1.0) (2015-12-01)
|
|
4
28
|
|
|
5
29
|
[Full Changelog](https://github.com/pearkes/tugboat/compare/v2.0.1...v2.1.0)
|
|
@@ -336,7 +360,7 @@
|
|
|
336
360
|
|
|
337
361
|
- region one unavailable on some clients, use NYC 2 [\#144](https://github.com/pearkes/tugboat/pull/144) ([Thetoxicarcade](https://github.com/Thetoxicarcade))
|
|
338
362
|
|
|
339
|
-
- Load config file from current directory, if not exit load from defaults [\#123](https://github.com/pearkes/tugboat/pull/123) ([
|
|
363
|
+
- Load config file from current directory, if not exit load from defaults [\#123](https://github.com/pearkes/tugboat/pull/123) ([tggo](https://github.com/tggo))
|
|
340
364
|
|
|
341
365
|
- improves droplets list/info prints [\#115](https://github.com/pearkes/tugboat/pull/115) ([petems](https://github.com/petems))
|
|
342
366
|
|
data/README.md
CHANGED
|
@@ -36,6 +36,28 @@ This will create a .tugboat file in your home folder (eg. ~/.tugboat).
|
|
|
36
36
|
|
|
37
37
|
Tugboat will look for a .tugboat config file first in the current directory you're running it in, then will look for one in the home directory.
|
|
38
38
|
|
|
39
|
+
An example of a `.tugboat` file:
|
|
40
|
+
|
|
41
|
+
```yaml
|
|
42
|
+
---
|
|
43
|
+
authentication:
|
|
44
|
+
access_token: f8sazukxeh729ggxh9gjavvzw5cabdpq95txpzhz6ep6jvtquxztfkf2chyejcsg5
|
|
45
|
+
ssh:
|
|
46
|
+
ssh_user: root
|
|
47
|
+
ssh_key_path: "~/.ssh/id_rsa"
|
|
48
|
+
ssh_port: '22'
|
|
49
|
+
defaults:
|
|
50
|
+
region: nyc2
|
|
51
|
+
image: ubuntu-14-04-x64
|
|
52
|
+
size: 512mb
|
|
53
|
+
ssh_key: ['1234','5678']
|
|
54
|
+
private_networking: 'false'
|
|
55
|
+
backups_enabled: 'false'
|
|
56
|
+
ip6: 'false'
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
|
|
39
61
|
## Usage
|
|
40
62
|
|
|
41
63
|
### Retrieve a list of your droplets
|
|
@@ -510,4 +532,4 @@ Request Body:
|
|
|
510
532
|
|
|
511
533
|
## Contributing
|
|
512
534
|
|
|
513
|
-
See the [contributing guide](CONTRIBUTING.md).
|
|
535
|
+
See the [contributing guide](CONTRIBUTING.md).
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
---
|
|
2
|
+
http_interactions:
|
|
3
|
+
- request:
|
|
4
|
+
method: post
|
|
5
|
+
uri: https://api.digitalocean.com/v2/droplets
|
|
6
|
+
body:
|
|
7
|
+
encoding: UTF-8
|
|
8
|
+
string: '{"name":"droplet-with-array-of-keys","size":"512mb","image":"ubuntu-14-04-x64","region":"nyc2","ssh_keys":["1234","5678"],"private_networking":"false","backups_enabled":"false","ipv6":"false","user_data":null}'
|
|
9
|
+
headers:
|
|
10
|
+
Authorization:
|
|
11
|
+
- Bearer f8sazukxeh729ggxh9gjavvzw5cabdpq95txpzhz6ep6jvtquxztfkf2chyejcsg5
|
|
12
|
+
Content-Type:
|
|
13
|
+
- application/json
|
|
14
|
+
User-Agent:
|
|
15
|
+
- Faraday v0.9.2
|
|
16
|
+
Accept-Encoding:
|
|
17
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
|
18
|
+
Accept:
|
|
19
|
+
- "*/*"
|
|
20
|
+
response:
|
|
21
|
+
status:
|
|
22
|
+
code: 202
|
|
23
|
+
message: Accepted
|
|
24
|
+
headers:
|
|
25
|
+
Server:
|
|
26
|
+
- cloudflare-nginx
|
|
27
|
+
Date:
|
|
28
|
+
- Tue, 16 Feb 2016 10:10:51 GMT
|
|
29
|
+
Content-Type:
|
|
30
|
+
- application/json; charset=utf-8
|
|
31
|
+
Transfer-Encoding:
|
|
32
|
+
- chunked
|
|
33
|
+
Connection:
|
|
34
|
+
- keep-alive
|
|
35
|
+
Set-Cookie:
|
|
36
|
+
- __cfduid=hm6ha3pvo7hm6ha3pvo7hm6ha3pvo7; expires=Wed, 15-Feb-17
|
|
37
|
+
10:10:50 GMT; path=/; domain=.digitalocean.com; HttpOnly
|
|
38
|
+
Status:
|
|
39
|
+
- 202 Accepted
|
|
40
|
+
X-Frame-Options:
|
|
41
|
+
- SAMEORIGIN
|
|
42
|
+
X-Xss-Protection:
|
|
43
|
+
- 1; mode=block
|
|
44
|
+
X-Content-Type-Options:
|
|
45
|
+
- nosniff
|
|
46
|
+
Ratelimit-Limit:
|
|
47
|
+
- '5000'
|
|
48
|
+
Ratelimit-Remaining:
|
|
49
|
+
- '4994'
|
|
50
|
+
Ratelimit-Reset:
|
|
51
|
+
- '1455617507'
|
|
52
|
+
Cache-Control:
|
|
53
|
+
- no-cache
|
|
54
|
+
X-Request-Id:
|
|
55
|
+
- 8d869cf8-bbeb-48fa-ae84-32f1b01ebab6
|
|
56
|
+
X-Runtime:
|
|
57
|
+
- '0.246402'
|
|
58
|
+
Cf-Ray:
|
|
59
|
+
- 27587709cabc1377-LHR
|
|
60
|
+
body:
|
|
61
|
+
encoding: UTF-8
|
|
62
|
+
string: '{"droplet":{"id":276961,"name":"droplet-with-array-of-keys","memory":512,"vcpus":1,"disk":20,"locked":true,"status":"new","kernel":{"id":6297,"name":"Ubuntu
|
|
63
|
+
14.04 x64 vmlinuz-3.13.0-71-generic","version":"3.13.0-71-generic"},"created_at":"2016-02-16T10:10:50Z","features":["virtio"],"backup_ids":[],"next_backup_window":null,"snapshot_ids":[],"image":{"id":14782728,"name":"14.04.3
|
|
64
|
+
x64","distribution":"Ubuntu","slug":"ubuntu-14-04-x64","public":true,"regions":["nyc1","sfo1","nyc2","ams2","sgp1","lon1","nyc3","ams3","fra1","tor1"],"created_at":"2015-12-10T16:42:21Z","min_disk_size":20,"type":"snapshot"},"size":{"slug":"512mb","memory":512,"vcpus":1,"disk":20,"transfer":1.0,"price_monthly":5.0,"price_hourly":0.00744,"regions":["ams1","ams2","ams3","fra1","lon1","nyc1","nyc2","nyc3","sfo1","sgp1","tor1"],"available":true},"size_slug":"512mb","networks":{"v4":[],"v6":[]},"region":{"name":"New
|
|
65
|
+
York 2","slug":"nyc2","sizes":["1gb","2gb","4gb","8gb","32gb","64gb","512mb","48gb","16gb"],"features":["private_networking","backups","ipv6","metadata"],"available":true},"tags":[]},"links":{"actions":[{"id":84162954,"rel":"create","href":"https://api.digitalocean.com/v2/actions/27624451"}]}}'
|
|
66
|
+
http_version:
|
|
67
|
+
recorded_at: Tue, 16 Feb 2016 10:10:51 GMT
|
|
68
|
+
recorded_with: VCR 2.9.3
|
data/features/support/env.rb
CHANGED
|
@@ -1,9 +1,40 @@
|
|
|
1
1
|
require 'aruba/cucumber'
|
|
2
|
+
require 'aruba/in_process'
|
|
3
|
+
require 'aruba/spawn_process'
|
|
4
|
+
require 'vcr'
|
|
5
|
+
require 'webmock'
|
|
6
|
+
require 'tugboat'
|
|
2
7
|
|
|
3
|
-
|
|
8
|
+
VCR.configure do |c|
|
|
9
|
+
c.hook_into :webmock
|
|
10
|
+
c.cassette_library_dir = 'features/cassettes'
|
|
11
|
+
c.default_cassette_options = { :record => :new_episodes }
|
|
12
|
+
end
|
|
4
13
|
|
|
14
|
+
VCR.cucumber_tags do |t|
|
|
15
|
+
t.tag '@vcr', :use_scenario_name => true
|
|
5
16
|
end
|
|
6
17
|
|
|
7
|
-
|
|
18
|
+
class VcrFriendlyMain
|
|
19
|
+
def initialize(argv, stdin, stdout, stderr, kernel)
|
|
20
|
+
@argv, @stdin, @stdout, @stderr, @kernel = argv, stdin, stdout, stderr, kernel
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
def execute!
|
|
24
|
+
$stdin = @stdin
|
|
25
|
+
$stdout = @stdout
|
|
26
|
+
Tugboat::CLI.start(@argv)
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
Before('@vcr') do
|
|
31
|
+
Aruba::InProcess.main_class = VcrFriendlyMain
|
|
32
|
+
Aruba.process = Aruba::InProcess
|
|
33
|
+
end
|
|
8
34
|
|
|
35
|
+
After('@vcr') do
|
|
36
|
+
Aruba.process = Aruba::SpawnProcess
|
|
37
|
+
$stdin = STDIN
|
|
38
|
+
$stdout = STDOUT
|
|
39
|
+
VCR.eject_cassette
|
|
9
40
|
end
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
Feature: config
|
|
2
|
+
In order to have an easier time connecting to droplets
|
|
3
|
+
As a user
|
|
4
|
+
I should be able to supply an array of ssh keys for a machine
|
|
5
|
+
|
|
6
|
+
@vcr
|
|
7
|
+
Scenario: Array of SSH Keys in Config
|
|
8
|
+
Given a '.tugboat' config with data:
|
|
9
|
+
"""
|
|
10
|
+
---
|
|
11
|
+
authentication:
|
|
12
|
+
access_token: f8sazukxeh729ggxh9gjavvzw5cabdpq95txpzhz6ep6jvtquxztfkf2chyejcsg5
|
|
13
|
+
ssh:
|
|
14
|
+
ssh_user: bobby_sousa
|
|
15
|
+
ssh_key_path: "~/.ssh/id_rsa"
|
|
16
|
+
ssh_port: '22'
|
|
17
|
+
defaults:
|
|
18
|
+
region: nyc2
|
|
19
|
+
image: ubuntu-14-04-x64
|
|
20
|
+
size: 512mb
|
|
21
|
+
ssh_key: ['1234','5678']
|
|
22
|
+
private_networking: 'false'
|
|
23
|
+
backups_enabled: 'false'
|
|
24
|
+
ip6: 'false'
|
|
25
|
+
"""
|
|
26
|
+
When I run `tugboat create droplet-with-array-of-keys`
|
|
27
|
+
Then the exit status should not be 1
|
|
28
|
+
And the output should contain "Queueing creation of droplet 'droplet-with-array-of-keys'...Droplet created!"
|
|
@@ -3,25 +3,27 @@ Feature: config
|
|
|
3
3
|
As a user
|
|
4
4
|
I should be able to load tugboat config from a .tugboat in the current directory
|
|
5
5
|
|
|
6
|
-
Scenario:
|
|
7
|
-
Given a
|
|
8
|
-
|
|
6
|
+
Scenario: Read config from current directory
|
|
7
|
+
Given a '.tugboat' config with data:
|
|
8
|
+
"""
|
|
9
9
|
---
|
|
10
10
|
authentication:
|
|
11
|
-
|
|
12
|
-
api_key: BAR
|
|
11
|
+
access_token: FOO
|
|
13
12
|
ssh:
|
|
14
13
|
ssh_user: janedoe
|
|
15
14
|
ssh_key_path: "/Users/janedoe/.ssh/id_rsa"
|
|
16
15
|
ssh_port: '22'
|
|
17
16
|
defaults:
|
|
18
|
-
region:
|
|
19
|
-
image:
|
|
20
|
-
size:
|
|
21
|
-
ssh_key: ''
|
|
17
|
+
region: nyc2
|
|
18
|
+
image: ubuntu-14-04-x64
|
|
19
|
+
size: 512mb
|
|
20
|
+
ssh_key: ['1234','5678']
|
|
22
21
|
private_networking: 'false'
|
|
23
22
|
backups_enabled: 'false'
|
|
24
|
-
|
|
23
|
+
ip6: 'false'
|
|
24
|
+
"""
|
|
25
25
|
When I run `tugboat config`
|
|
26
26
|
Then the exit status should not be 1
|
|
27
27
|
And the output should contain "ssh_user: janedoe"
|
|
28
|
+
And the output should contain "'1234'"
|
|
29
|
+
And the output should contain "'5678'"
|
|
@@ -47,10 +47,11 @@ module Tugboat
|
|
|
47
47
|
droplet_backups_enabled = env["create_droplet_backups_enabled"] :
|
|
48
48
|
droplet_backups_enabled = env["config"].default_backups_enabled
|
|
49
49
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
50
|
+
if droplet_ssh_key_ids.kind_of?(Array)
|
|
51
|
+
droplet_key_array = droplet_ssh_key_ids
|
|
52
|
+
else
|
|
53
|
+
droplet_key_array = droplet_ssh_key_ids.split(',')
|
|
54
|
+
end
|
|
54
55
|
|
|
55
56
|
create_opts = {
|
|
56
57
|
:name => env["create_droplet_name"],
|
data/lib/tugboat/version.rb
CHANGED
data/tugboat.gemspec
CHANGED
|
@@ -30,8 +30,9 @@ Gem::Specification.new do |gem|
|
|
|
30
30
|
gem.add_development_dependency 'simplecov', '0.10'
|
|
31
31
|
gem.add_development_dependency 'simplecov-console', '0.2.0'
|
|
32
32
|
gem.add_development_dependency 'coveralls', '~> 0.6.7'
|
|
33
|
-
gem.add_development_dependency 'aruba', '
|
|
33
|
+
gem.add_development_dependency 'aruba', '0.7.4'
|
|
34
34
|
gem.add_development_dependency 'pry'
|
|
35
|
+
gem.add_development_dependency 'vcr', '2.9.3'
|
|
35
36
|
|
|
36
37
|
gem.post_install_message = '***************************************'
|
|
37
38
|
gem.post_install_message = ' . o .. '
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: tugboat
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.2.
|
|
4
|
+
version: 2.2.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Jack Pearkes
|
|
@@ -10,7 +10,7 @@ authors:
|
|
|
10
10
|
autorequire:
|
|
11
11
|
bindir: bin
|
|
12
12
|
cert_chain: []
|
|
13
|
-
date: 2016-
|
|
13
|
+
date: 2016-02-16 00:00:00.000000000 Z
|
|
14
14
|
dependencies:
|
|
15
15
|
- !ruby/object:Gem::Dependency
|
|
16
16
|
name: thor
|
|
@@ -170,16 +170,16 @@ dependencies:
|
|
|
170
170
|
name: aruba
|
|
171
171
|
requirement: !ruby/object:Gem::Requirement
|
|
172
172
|
requirements:
|
|
173
|
-
- -
|
|
173
|
+
- - '='
|
|
174
174
|
- !ruby/object:Gem::Version
|
|
175
|
-
version: 0.
|
|
175
|
+
version: 0.7.4
|
|
176
176
|
type: :development
|
|
177
177
|
prerelease: false
|
|
178
178
|
version_requirements: !ruby/object:Gem::Requirement
|
|
179
179
|
requirements:
|
|
180
|
-
- -
|
|
180
|
+
- - '='
|
|
181
181
|
- !ruby/object:Gem::Version
|
|
182
|
-
version: 0.
|
|
182
|
+
version: 0.7.4
|
|
183
183
|
- !ruby/object:Gem::Dependency
|
|
184
184
|
name: pry
|
|
185
185
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -194,6 +194,20 @@ dependencies:
|
|
|
194
194
|
- - ">="
|
|
195
195
|
- !ruby/object:Gem::Version
|
|
196
196
|
version: '0'
|
|
197
|
+
- !ruby/object:Gem::Dependency
|
|
198
|
+
name: vcr
|
|
199
|
+
requirement: !ruby/object:Gem::Requirement
|
|
200
|
+
requirements:
|
|
201
|
+
- - '='
|
|
202
|
+
- !ruby/object:Gem::Version
|
|
203
|
+
version: 2.9.3
|
|
204
|
+
type: :development
|
|
205
|
+
prerelease: false
|
|
206
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
207
|
+
requirements:
|
|
208
|
+
- - '='
|
|
209
|
+
- !ruby/object:Gem::Version
|
|
210
|
+
version: 2.9.3
|
|
197
211
|
description: A command line tool for interacting with your DigitalOcean droplets.
|
|
198
212
|
email:
|
|
199
213
|
- jackpearkes@gmail.com
|
|
@@ -212,8 +226,10 @@ files:
|
|
|
212
226
|
- README.md
|
|
213
227
|
- Rakefile
|
|
214
228
|
- bin/tugboat
|
|
229
|
+
- features/cassettes/config/Array_of_SSH_Keys_in_Config.yml
|
|
215
230
|
- features/step_definitions/steps.rb
|
|
216
231
|
- features/support/env.rb
|
|
232
|
+
- features/tugboat/config_array_of_ssh_keys.feature
|
|
217
233
|
- features/tugboat/config_current_directory.feature
|
|
218
234
|
- lib/tugboat.rb
|
|
219
235
|
- lib/tugboat/cli.rb
|
|
@@ -352,8 +368,10 @@ signing_key:
|
|
|
352
368
|
specification_version: 4
|
|
353
369
|
summary: A command line tool for interacting with your DigitalOcean droplets.
|
|
354
370
|
test_files:
|
|
371
|
+
- features/cassettes/config/Array_of_SSH_Keys_in_Config.yml
|
|
355
372
|
- features/step_definitions/steps.rb
|
|
356
373
|
- features/support/env.rb
|
|
374
|
+
- features/tugboat/config_array_of_ssh_keys.feature
|
|
357
375
|
- features/tugboat/config_current_directory.feature
|
|
358
376
|
- spec/cli/add_key_spec.rb
|
|
359
377
|
- spec/cli/authorize_cli_spec.rb
|