tugboat 2.2.2 → 2.2.3
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/.rubocop.yml +520 -0
- data/CHANGELOG.md +9 -0
- data/Gemfile +0 -6
- data/README.md +34 -2
- data/Rakefile +6 -1
- data/bin/tugboat +2 -2
- data/features/cassettes/config/Array_of_SSH_Keys_in_Config.yml +1 -1
- data/features/cassettes/config/Single_SSH_key_as_number_in_config.yml +1 -1
- data/features/step_definitions/steps.rb +1 -1
- data/features/support/env.rb +7 -3
- data/lib/tugboat.rb +2 -2
- data/lib/tugboat/cli.rb +394 -444
- data/lib/tugboat/config.rb +43 -61
- data/lib/tugboat/middleware.rb +33 -33
- data/lib/tugboat/middleware/add_key.rb +12 -13
- data/lib/tugboat/middleware/ask_for_credentials.rb +12 -13
- data/lib/tugboat/middleware/base.rb +25 -20
- data/lib/tugboat/middleware/check_configuration.rb +3 -6
- data/lib/tugboat/middleware/check_credentials.rb +0 -1
- data/lib/tugboat/middleware/check_droplet_active.rb +2 -4
- data/lib/tugboat/middleware/check_droplet_inactive.rb +2 -4
- data/lib/tugboat/middleware/config.rb +3 -5
- data/lib/tugboat/middleware/confirm_action.rb +4 -6
- data/lib/tugboat/middleware/create_droplet.rb +27 -44
- data/lib/tugboat/middleware/custom_logger.rb +52 -54
- data/lib/tugboat/middleware/destroy_droplet.rb +5 -6
- data/lib/tugboat/middleware/destroy_image.rb +5 -6
- data/lib/tugboat/middleware/find_droplet.rb +43 -47
- data/lib/tugboat/middleware/find_image.rb +23 -29
- data/lib/tugboat/middleware/halt_droplet.rb +9 -10
- data/lib/tugboat/middleware/info_droplet.rb +30 -33
- data/lib/tugboat/middleware/info_image.rb +1 -1
- data/lib/tugboat/middleware/inject_client.rb +8 -10
- data/lib/tugboat/middleware/inject_configuration.rb +1 -2
- data/lib/tugboat/middleware/list_droplets.rb +9 -10
- data/lib/tugboat/middleware/list_images.rb +9 -9
- data/lib/tugboat/middleware/list_regions.rb +1 -1
- data/lib/tugboat/middleware/list_sizes.rb +1 -1
- data/lib/tugboat/middleware/list_ssh_keys.rb +1 -3
- data/lib/tugboat/middleware/password_reset.rb +6 -7
- data/lib/tugboat/middleware/rebuild_droplet.rb +7 -7
- data/lib/tugboat/middleware/resize_droplet.rb +6 -7
- data/lib/tugboat/middleware/restart_droplet.rb +4 -11
- data/lib/tugboat/middleware/snapshot_droplet.rb +7 -8
- data/lib/tugboat/middleware/ssh_droplet.rb +30 -31
- data/lib/tugboat/middleware/start_droplet.rb +5 -5
- data/lib/tugboat/middleware/wait_for_state.rb +2 -3
- data/lib/tugboat/version.rb +1 -1
- data/spec/cli/add_key_spec.rb +25 -28
- data/spec/cli/authorize_cli_spec.rb +57 -60
- data/spec/cli/config_cli_spec.rb +8 -11
- data/spec/cli/create_cli_spec.rb +40 -46
- data/spec/cli/debug_cli_spec.rb +29 -29
- data/spec/cli/destroy_cli_spec.rb +58 -60
- data/spec/cli/destroy_image_cli_spec.rb +42 -45
- data/spec/cli/droplets_cli_spec.rb +62 -64
- data/spec/cli/env_variable_spec.rb +14 -15
- data/spec/cli/halt_cli_spec.rb +65 -69
- data/spec/cli/help_cli_spec.rb +8 -8
- data/spec/cli/images_cli_spec.rb +28 -30
- data/spec/cli/info_cli_spec.rb +144 -147
- data/spec/cli/info_image_cli_spec.rb +57 -60
- data/spec/cli/keys_cli_spec.rb +8 -10
- data/spec/cli/password_reset_cli_spec.rb +56 -56
- data/spec/cli/rebuild_cli_spec.rb +194 -198
- data/spec/cli/regions_cli_spec.rb +8 -8
- data/spec/cli/resize_cli_spec.rb +54 -56
- data/spec/cli/restart_cli_spec.rb +53 -57
- data/spec/cli/sizes_cli_spec.rb +7 -8
- data/spec/cli/snapshot_cli_spec.rb +50 -53
- data/spec/cli/ssh_cli_spec.rb +41 -42
- data/spec/cli/start_cli_spec.rb +48 -52
- data/spec/cli/verify_cli_spec.rb +22 -25
- data/spec/cli/version_cli_spec.rb +6 -8
- data/spec/cli/wait_cli_spec.rb +50 -52
- data/spec/config_spec.rb +56 -57
- data/spec/middleware/base_spec.rb +5 -6
- data/spec/middleware/check_configuration_spec.rb +5 -7
- data/spec/middleware/check_credentials_spec.rb +9 -10
- data/spec/middleware/check_droplet_active_spec.rb +5 -7
- data/spec/middleware/check_droplet_inactive_spec.rb +5 -7
- data/spec/middleware/find_droplet_spec.rb +4 -5
- data/spec/middleware/find_image_spec.rb +4 -5
- data/spec/middleware/inject_client_spec.rb +9 -12
- data/spec/middleware/inject_configuration_spec.rb +4 -7
- data/spec/middleware/ssh_droplet_spec.rb +70 -73
- data/spec/shared/environment.rb +18 -20
- data/spec/spec_helper.rb +4 -4
- data/tugboat.gemspec +10 -6
- metadata +88 -17
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,14 @@
|
|
1
1
|
# Change Log
|
2
2
|
|
3
|
+
## [v2.2.2](https://github.com/pearkes/tugboat/tree/v2.2.2) (2016-02-18)
|
4
|
+
[Full Changelog](https://github.com/pearkes/tugboat/compare/v2.2.1...v2.2.2)
|
5
|
+
|
6
|
+
**Merged pull requests:**
|
7
|
+
|
8
|
+
- Changes authorize command to ask for array [\#241](https://github.com/pearkes/tugboat/pull/241) ([petems](https://github.com/petems))
|
9
|
+
- Fix ssh key id as fixnum [\#240](https://github.com/pearkes/tugboat/pull/240) ([petems](https://github.com/petems))
|
10
|
+
- Fix ssh wait option [\#239](https://github.com/pearkes/tugboat/pull/239) ([petems](https://github.com/petems))
|
11
|
+
|
3
12
|
## [v2.2.1](https://github.com/pearkes/tugboat/tree/v2.2.1) (2016-02-16)
|
4
13
|
[Full Changelog](https://github.com/pearkes/tugboat/compare/v2.2.0...v2.2.1)
|
5
14
|
|
data/Gemfile
CHANGED
@@ -2,9 +2,3 @@ source 'https://rubygems.org'
|
|
2
2
|
|
3
3
|
# Specify your gem's dependencies in tugboat.gemspec
|
4
4
|
gemspec
|
5
|
-
|
6
|
-
group :development do
|
7
|
-
# Random order is not in the Aruba Cucumber yet...
|
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
|
-
end
|
data/README.md
CHANGED
@@ -4,6 +4,20 @@
|
|
4
4
|
|
5
5
|
A command line tool for interacting with your [DigitalOcean](https://www.digitalocean.com/) droplets.
|
6
6
|
|
7
|
+
## History
|
8
|
+
|
9
|
+
When Tugboat was created, DigitalOcean was an extremely new cloud provider. They'd only released their public beta back in [2012](https://whoapi.com/blog/1497/fast-growing-digitalocean-is-fueled-by-customer-love/), and their new SSD backed machines only primiered in early [2013](https://techcrunch.com/2013/01/15/techstars-graduate-digitalocean-switches-to-ssd-for-its-5-per-month-vps-to-take-on-linode-and-rackspace/).
|
10
|
+
|
11
|
+
Tugboat started out life around that time, [back in April 2013](https://github.com/pearkes/tugboat/commit/f0fbc1f438cce81c286f0e60014dc4393ac95cb6). Back then, there were no official libraries for DigitalOcean, and the 1.0 API was a bit unstable and occasionally flakey.
|
12
|
+
|
13
|
+
Since then, DigitalOcean has expanded rapidly and has started offering official libraries.
|
14
|
+
|
15
|
+
They now have an offically maintained command-line client called [doctl](https://github.com/digitalocean/doctl).
|
16
|
+
|
17
|
+
Some people have asked, **where does that leave Tugboat?**
|
18
|
+
|
19
|
+
If you want the bleeding edge of new features and official support from DigitalOcean engineers, **Doctl is the way to go**. However, **as long as there is one other user out there who likes Tugboat and it's workflow, I will try my darndest to maintain this project, investigate bugs, implement new features and merge pull-requests.**
|
20
|
+
|
7
21
|
## Installation
|
8
22
|
|
9
23
|
gem install tugboat
|
@@ -124,7 +138,7 @@ match.
|
|
124
138
|
|
125
139
|
Print info in machine-readable format. The ``--porcelain`` flag silences extra output for easy parsing. Fuzzy name matching is not supported with the ``--porcelain`` flag.
|
126
140
|
|
127
|
-
$ tugboat info -n pearkes-admin-001 --
|
141
|
+
$ tugboat info -n pearkes-admin-001 --porcelain
|
128
142
|
name pearkes-admin-001
|
129
143
|
id 13231512
|
130
144
|
status active
|
@@ -221,6 +235,24 @@ Or just list images that you have created.
|
|
221
235
|
San Francisco 1 (slug: sfo1)
|
222
236
|
Singapore 1 (slug: sgp1)
|
223
237
|
|
238
|
+
### Add SSH keys
|
239
|
+
|
240
|
+
$ tugboat add-key digitalocean
|
241
|
+
Possible public key paths from /Users/pearkes/.ssh:
|
242
|
+
|
243
|
+
/Users/pearkes/.ssh/digitalocean.pub
|
244
|
+
/Users/pearkes/.ssh/fog.pub
|
245
|
+
/Users/pearkes/.ssh/github.pub
|
246
|
+
/Users/pearkes/.ssh/id_rsa.pub
|
247
|
+
/Users/pearkes/.ssh/terraform.pub
|
248
|
+
|
249
|
+
Enter the path to your SSH key: /Users/petersouter/.ssh/digitalocean.pub
|
250
|
+
Queueing upload of SSH key 'digitalocean'...SSH Key uploaded
|
251
|
+
|
252
|
+
Name: digitalocean
|
253
|
+
ID: 1384812
|
254
|
+
...
|
255
|
+
|
224
256
|
### List SSH Keys
|
225
257
|
|
226
258
|
$ tugboat keys
|
@@ -279,7 +311,7 @@ D, [2015-12-06T12:04:27.149334 #92772] DEBUG -- : Request Headers:
|
|
279
311
|
----------------
|
280
312
|
Authorization : Bearer [TOKEN REDACTED]
|
281
313
|
Content-Type : application/json
|
282
|
-
User-Agent : Faraday v0.
|
314
|
+
User-Agent : Faraday v0.11.0
|
283
315
|
|
284
316
|
Request Body:
|
285
317
|
-------------
|
data/Rakefile
CHANGED
@@ -4,6 +4,7 @@ Bundler.require(:development)
|
|
4
4
|
require 'bundler/gem_tasks'
|
5
5
|
require 'rspec/core/rake_task'
|
6
6
|
require 'cucumber/rake/task'
|
7
|
+
require 'rubocop/rake_task'
|
7
8
|
|
8
9
|
RSpec::Core::RakeTask.new(:spec)
|
9
10
|
|
@@ -11,4 +12,8 @@ Cucumber::Rake::Task.new(:features) do |t|
|
|
11
12
|
t.cucumber_opts = %w(--format pretty --order random)
|
12
13
|
end
|
13
14
|
|
14
|
-
|
15
|
+
RuboCop::RakeTask.new(:rubocop) do |t|
|
16
|
+
t.options = ['--display-cop-names']
|
17
|
+
end
|
18
|
+
|
19
|
+
task default: [:spec, :features]
|
data/bin/tugboat
CHANGED
@@ -3,8 +3,8 @@
|
|
3
3
|
# https://github.com/mitchellh/vagrant/blob/8cc4910fa9ca6059697459d0cdee1557af8d0507/bin/vagrant#L3-L6
|
4
4
|
# Catch any ctrl+c's to avoid stack traces. Thanks Mitchell. ^^
|
5
5
|
|
6
|
-
Signal.trap(
|
6
|
+
Signal.trap('INT') { exit 1 }
|
7
7
|
|
8
|
-
require
|
8
|
+
require 'tugboat'
|
9
9
|
|
10
10
|
Tugboat::CLI.start(ARGV)
|
data/features/support/env.rb
CHANGED
@@ -8,16 +8,20 @@ require 'tugboat'
|
|
8
8
|
VCR.configure do |c|
|
9
9
|
c.hook_into :webmock
|
10
10
|
c.cassette_library_dir = 'features/cassettes'
|
11
|
-
c.default_cassette_options = { :
|
11
|
+
c.default_cassette_options = { record: :new_episodes }
|
12
12
|
end
|
13
13
|
|
14
14
|
VCR.cucumber_tags do |t|
|
15
|
-
t.tag
|
15
|
+
t.tag '@vcr', use_scenario_name: true
|
16
16
|
end
|
17
17
|
|
18
18
|
class VcrFriendlyMain
|
19
19
|
def initialize(argv, stdin, stdout, stderr, kernel)
|
20
|
-
@argv
|
20
|
+
@argv = argv
|
21
|
+
@stdin = stdin
|
22
|
+
@stdout = stdout
|
23
|
+
@stderr = stderr
|
24
|
+
@kernel = kernel
|
21
25
|
end
|
22
26
|
|
23
27
|
def execute!
|
data/lib/tugboat.rb
CHANGED
data/lib/tugboat/cli.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
require 'thor'
|
2
2
|
|
3
3
|
module Tugboat
|
4
|
-
autoload :Middleware,
|
4
|
+
autoload :Middleware, 'tugboat/middleware'
|
5
5
|
|
6
6
|
class CLI < Thor
|
7
7
|
include Thor::Actions
|
@@ -9,21 +9,19 @@ module Tugboat
|
|
9
9
|
|
10
10
|
!check_unknown_options
|
11
11
|
|
12
|
-
class_option :quiet, type: :boolean, aliases:
|
12
|
+
class_option :quiet, type: :boolean, aliases: '-q'
|
13
13
|
|
14
|
-
map
|
15
|
-
|
16
|
-
|
14
|
+
map '--version' => :version,
|
15
|
+
'-v' => :version,
|
16
|
+
'password-reset' => :password_reset
|
17
17
|
|
18
|
-
desc
|
19
|
-
def help(meth=nil)
|
18
|
+
desc 'help [COMMAND]', 'Describe commands or a specific command'
|
19
|
+
def help(meth = nil)
|
20
20
|
super
|
21
|
-
|
22
|
-
say "To learn more or to contribute, please see github.com/pearkes/tugboat"
|
23
|
-
end
|
21
|
+
say 'To learn more or to contribute, please see github.com/pearkes/tugboat' unless meth
|
24
22
|
end
|
25
23
|
|
26
|
-
desc
|
24
|
+
desc 'authorize', 'Authorize a DigitalOcean account with tugboat'
|
27
25
|
long_desc "This takes you through a workflow for adding configuration
|
28
26
|
details to tugboat. First, you are asked for your API and Client keys,
|
29
27
|
which are stored in ~/.tugboat.
|
@@ -35,511 +33,463 @@ module Tugboat
|
|
35
33
|
$USER environment variable.
|
36
34
|
"
|
37
35
|
def authorize
|
38
|
-
Middleware.sequence_authorize.call(
|
39
|
-
|
40
|
-
"user_quiet" => options[:quiet]
|
41
|
-
})
|
36
|
+
Middleware.sequence_authorize.call('tugboat_action' => __method__,
|
37
|
+
'user_quiet' => options[:quiet])
|
42
38
|
end
|
43
39
|
|
44
|
-
desc
|
40
|
+
desc 'config', 'Show your current config information'
|
45
41
|
long_desc "This shows the current information in the .tugboat config
|
46
42
|
being used by the app
|
47
43
|
"
|
48
|
-
method_option
|
49
|
-
:
|
50
|
-
:
|
51
|
-
:
|
52
|
-
:
|
44
|
+
method_option 'hide',
|
45
|
+
type: :boolean,
|
46
|
+
default: true,
|
47
|
+
aliases: '-h',
|
48
|
+
desc: 'Hide your API keys'
|
53
49
|
def config
|
54
|
-
Middleware.sequence_config.call(
|
55
|
-
|
56
|
-
"user_hide_keys" => options[:hide],
|
57
|
-
})
|
50
|
+
Middleware.sequence_config.call('tugboat_action' => __method__,
|
51
|
+
'user_hide_keys' => options[:hide])
|
58
52
|
end
|
59
53
|
|
60
|
-
desc
|
54
|
+
desc 'verify', 'Check your DigitalOcean credentials'
|
61
55
|
long_desc "This tests that your credentials created by the \`authorize\`
|
62
56
|
command that are stored in ~/.tugboat are correct and allow you to connect
|
63
57
|
to the API without errors.
|
64
58
|
"
|
65
59
|
def verify
|
66
|
-
Middleware.sequence_verify.call(
|
67
|
-
|
68
|
-
"user_quiet" => options[:quiet]
|
69
|
-
})
|
60
|
+
Middleware.sequence_verify.call('tugboat_action' => __method__,
|
61
|
+
'user_quiet' => options[:quiet])
|
70
62
|
end
|
71
63
|
|
72
|
-
method_option
|
73
|
-
:
|
74
|
-
:
|
75
|
-
:
|
76
|
-
:
|
77
|
-
desc
|
64
|
+
method_option 'include_urls',
|
65
|
+
type: :boolean,
|
66
|
+
default: false,
|
67
|
+
aliases: '-i',
|
68
|
+
desc: 'Include URLs for the droplets (can be opened in a browser)'
|
69
|
+
desc 'droplets [OPTIONS]', 'Retrieve a list of your droplets'
|
78
70
|
def droplets
|
79
|
-
Middleware.sequence_list_droplets.call(
|
80
|
-
|
81
|
-
|
82
|
-
"include_urls" => options["include_urls"]
|
83
|
-
})
|
71
|
+
Middleware.sequence_list_droplets.call('tugboat_action' => __method__,
|
72
|
+
'user_quiet' => options[:quiet],
|
73
|
+
'include_urls' => options['include_urls'])
|
84
74
|
end
|
85
75
|
|
86
|
-
desc
|
87
|
-
method_option
|
88
|
-
:
|
89
|
-
:
|
90
|
-
:
|
91
|
-
:
|
76
|
+
desc 'images [OPTIONS]', 'Retrieve a list of images'
|
77
|
+
method_option 'show_just_private_images',
|
78
|
+
type: :boolean,
|
79
|
+
default: false,
|
80
|
+
aliases: '-p',
|
81
|
+
desc: 'Show just private images'
|
92
82
|
def images
|
93
|
-
Middleware.sequence_list_images.call(
|
94
|
-
|
95
|
-
|
96
|
-
"user_quiet" => options[:quiet]
|
97
|
-
})
|
83
|
+
Middleware.sequence_list_images.call('tugboat_action' => __method__,
|
84
|
+
'user_show_just_private_images' => options[:show_just_private_images],
|
85
|
+
'user_quiet' => options[:quiet])
|
98
86
|
end
|
99
87
|
|
100
|
-
desc
|
101
|
-
method_option
|
102
|
-
:
|
103
|
-
:
|
104
|
-
:
|
105
|
-
method_option
|
106
|
-
:
|
107
|
-
:
|
108
|
-
:
|
109
|
-
method_option
|
110
|
-
:
|
111
|
-
:
|
112
|
-
:
|
113
|
-
method_option
|
114
|
-
:
|
115
|
-
:
|
116
|
-
:
|
117
|
-
:
|
118
|
-
method_option
|
119
|
-
:
|
120
|
-
:
|
121
|
-
:
|
122
|
-
method_option
|
123
|
-
:
|
124
|
-
:
|
125
|
-
:
|
126
|
-
method_option
|
127
|
-
:
|
128
|
-
:
|
129
|
-
:
|
130
|
-
method_option
|
131
|
-
:
|
132
|
-
:
|
133
|
-
:
|
134
|
-
def ssh(name=nil)
|
135
|
-
Middleware.sequence_ssh_droplet.call(
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
"user_quiet" => options[:quiet],
|
147
|
-
})
|
88
|
+
desc 'ssh FUZZY_NAME', 'SSH into a droplet'
|
89
|
+
method_option 'id',
|
90
|
+
type: :string,
|
91
|
+
aliases: '-i',
|
92
|
+
desc: 'The ID of the droplet.'
|
93
|
+
method_option 'name',
|
94
|
+
type: :string,
|
95
|
+
aliases: '-n',
|
96
|
+
desc: 'The exact name of the droplet'
|
97
|
+
method_option 'ssh_port',
|
98
|
+
type: :string,
|
99
|
+
aliases: '-p',
|
100
|
+
desc: 'The custom SSH Port to connect to'
|
101
|
+
method_option 'use_private_ip',
|
102
|
+
type: :boolean,
|
103
|
+
aliases: '-t',
|
104
|
+
desc: 'Use Private IP while private IP is present',
|
105
|
+
default: false
|
106
|
+
method_option 'ssh_user',
|
107
|
+
type: :string,
|
108
|
+
aliases: '-u',
|
109
|
+
desc: 'Specifies which user to log in as'
|
110
|
+
method_option 'ssh_opts',
|
111
|
+
type: :string,
|
112
|
+
aliases: '-o',
|
113
|
+
desc: 'Custom SSH options'
|
114
|
+
method_option 'ssh_command',
|
115
|
+
type: :string,
|
116
|
+
aliases: ['-c', '-y'],
|
117
|
+
desc: 'Command to run on the droplet'
|
118
|
+
method_option 'wait',
|
119
|
+
type: :boolean,
|
120
|
+
aliases: '-w',
|
121
|
+
desc: 'Wait for droplet to become active before trying to SSH'
|
122
|
+
def ssh(name = nil)
|
123
|
+
Middleware.sequence_ssh_droplet.call('tugboat_action' => __method__,
|
124
|
+
'user_droplet_id' => options[:id],
|
125
|
+
'user_droplet_name' => options[:name],
|
126
|
+
'user_droplet_fuzzy_name' => name,
|
127
|
+
'user_droplet_ssh_port' => options[:ssh_port],
|
128
|
+
'user_droplet_ssh_user' => options[:ssh_user],
|
129
|
+
'user_droplet_use_private_ip' => options[:use_private_ip],
|
130
|
+
'user_droplet_ssh_opts' => options[:ssh_opts],
|
131
|
+
'user_droplet_ssh_command' => options[:ssh_command],
|
132
|
+
'user_droplet_ssh_wait' => options[:wait],
|
133
|
+
'user_quiet' => options[:quiet])
|
148
134
|
end
|
149
135
|
|
150
|
-
desc
|
151
|
-
method_option
|
152
|
-
:
|
153
|
-
:
|
154
|
-
:
|
155
|
-
method_option
|
156
|
-
:
|
157
|
-
:
|
158
|
-
:
|
159
|
-
method_option
|
160
|
-
:
|
161
|
-
:
|
162
|
-
:
|
163
|
-
method_option
|
164
|
-
:
|
165
|
-
:
|
166
|
-
:
|
167
|
-
method_option
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
method_option
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
method_option
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
method_option
|
180
|
-
:
|
181
|
-
:
|
182
|
-
:
|
136
|
+
desc 'create NAME', 'Create a droplet.'
|
137
|
+
method_option 'size',
|
138
|
+
type: :string,
|
139
|
+
aliases: '-s',
|
140
|
+
desc: 'The size slug of the droplet'
|
141
|
+
method_option 'image',
|
142
|
+
type: :string,
|
143
|
+
aliases: '-i',
|
144
|
+
desc: 'The image slug of the droplet'
|
145
|
+
method_option 'region',
|
146
|
+
type: :string,
|
147
|
+
aliases: '-r',
|
148
|
+
desc: 'The region slug of the droplet'
|
149
|
+
method_option 'keys',
|
150
|
+
type: :string,
|
151
|
+
aliases: '-k',
|
152
|
+
desc: 'A comma separated list of SSH key ids to add to the droplet'
|
153
|
+
method_option 'private_networking',
|
154
|
+
type: :boolean,
|
155
|
+
aliases: '-p',
|
156
|
+
desc: 'Enable private networking on the droplet'
|
157
|
+
method_option 'ip6',
|
158
|
+
type: :boolean,
|
159
|
+
aliases: '-l',
|
160
|
+
desc: 'Enable IP6 on the droplet'
|
161
|
+
method_option 'user_data',
|
162
|
+
type: :string,
|
163
|
+
aliases: '-u',
|
164
|
+
desc: 'Location of a file to read and use as user data'
|
165
|
+
method_option 'backups_enabled',
|
166
|
+
type: :boolean,
|
167
|
+
aliases: '-b',
|
168
|
+
desc: 'Enable backups on the droplet'
|
183
169
|
|
184
170
|
def create(name)
|
185
|
-
if name =~
|
171
|
+
if name =~ %r{^(-{0,2}help|-{1,2}h)}
|
186
172
|
help('create')
|
187
173
|
return
|
188
174
|
end
|
189
175
|
|
190
|
-
Middleware.sequence_create_droplet.call(
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
"user_quiet" => options[:quiet]
|
202
|
-
})
|
176
|
+
Middleware.sequence_create_droplet.call('tugboat_action' => __method__,
|
177
|
+
'create_droplet_ssh_key_ids' => options[:keys],
|
178
|
+
'create_droplet_size_slug' => options[:size],
|
179
|
+
'create_droplet_image_slug' => options[:image],
|
180
|
+
'create_droplet_region_slug' => options[:region],
|
181
|
+
'create_droplet_private_networking' => options[:private_networking],
|
182
|
+
'create_droplet_ip6' => options[:ip6],
|
183
|
+
'create_droplet_user_data' => options[:user_data],
|
184
|
+
'create_droplet_backups_enabled' => options[:backups_enabled],
|
185
|
+
'create_droplet_name' => name,
|
186
|
+
'user_quiet' => options[:quiet])
|
203
187
|
end
|
204
188
|
|
205
|
-
desc
|
206
|
-
method_option
|
207
|
-
:
|
208
|
-
:
|
209
|
-
:
|
210
|
-
method_option
|
211
|
-
:
|
212
|
-
:
|
213
|
-
:
|
214
|
-
method_option
|
215
|
-
:
|
216
|
-
:
|
217
|
-
:
|
218
|
-
method_option
|
219
|
-
:
|
220
|
-
:
|
221
|
-
:
|
222
|
-
method_option
|
223
|
-
:
|
224
|
-
:
|
225
|
-
:
|
226
|
-
def rebuild(name=nil, image_name=nil)
|
227
|
-
Middleware.sequence_rebuild_droplet.call(
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
"user_quiet" => options[:quiet]
|
237
|
-
})
|
189
|
+
desc 'rebuild FUZZY_NAME IMAGE_NAME', 'Rebuild a droplet.'
|
190
|
+
method_option 'id',
|
191
|
+
type: :string,
|
192
|
+
aliases: '-i',
|
193
|
+
desc: 'The ID of the droplet.'
|
194
|
+
method_option 'name',
|
195
|
+
type: :string,
|
196
|
+
aliases: '-n',
|
197
|
+
desc: 'The exact name of the droplet'
|
198
|
+
method_option 'confirm',
|
199
|
+
type: :boolean,
|
200
|
+
aliases: ['-c', '-y'],
|
201
|
+
desc: 'Skip confirmation of the action'
|
202
|
+
method_option 'image_id',
|
203
|
+
type: :numeric,
|
204
|
+
aliases: '-k',
|
205
|
+
desc: 'The ID of the image'
|
206
|
+
method_option 'image_name',
|
207
|
+
type: :string,
|
208
|
+
aliases: '-m',
|
209
|
+
desc: 'The exact name of the image'
|
210
|
+
def rebuild(name = nil, image_name = nil)
|
211
|
+
Middleware.sequence_rebuild_droplet.call('tugboat_action' => __method__,
|
212
|
+
'user_droplet_id' => options[:id],
|
213
|
+
'user_droplet_name' => options[:name],
|
214
|
+
'user_droplet_fuzzy_name' => name,
|
215
|
+
'user_image_id' => options[:image_id],
|
216
|
+
'user_image_name' => options[:image_name],
|
217
|
+
'user_image_fuzzy_name' => image_name,
|
218
|
+
'user_confirm_action' => options[:confirm],
|
219
|
+
'user_quiet' => options[:quiet])
|
238
220
|
end
|
239
221
|
|
240
|
-
desc
|
241
|
-
method_option
|
242
|
-
:
|
243
|
-
:
|
244
|
-
:
|
245
|
-
method_option
|
246
|
-
:
|
247
|
-
:
|
248
|
-
:
|
249
|
-
method_option
|
250
|
-
:
|
251
|
-
:
|
252
|
-
:
|
253
|
-
def destroy(name=nil)
|
254
|
-
Middleware.sequence_destroy_droplet.call(
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
"user_quiet" => options[:quiet]
|
261
|
-
})
|
222
|
+
desc 'destroy FUZZY_NAME', 'Destroy a droplet'
|
223
|
+
method_option 'id',
|
224
|
+
type: :string,
|
225
|
+
aliases: '-i',
|
226
|
+
desc: 'The ID of the droplet.'
|
227
|
+
method_option 'name',
|
228
|
+
type: :string,
|
229
|
+
aliases: '-n',
|
230
|
+
desc: 'The exact name of the droplet'
|
231
|
+
method_option 'confirm',
|
232
|
+
type: :boolean,
|
233
|
+
aliases: ['-c', '-y'],
|
234
|
+
desc: 'Skip confirmation of the action'
|
235
|
+
def destroy(name = nil)
|
236
|
+
Middleware.sequence_destroy_droplet.call('tugboat_action' => __method__,
|
237
|
+
'user_droplet_id' => options[:id],
|
238
|
+
'user_droplet_name' => options[:name],
|
239
|
+
'user_confirm_action' => options[:confirm],
|
240
|
+
'user_droplet_fuzzy_name' => name,
|
241
|
+
'user_quiet' => options[:quiet])
|
262
242
|
end
|
263
243
|
|
264
|
-
desc
|
265
|
-
method_option
|
266
|
-
:
|
267
|
-
:
|
268
|
-
:
|
269
|
-
method_option
|
270
|
-
:
|
271
|
-
:
|
272
|
-
:
|
273
|
-
method_option
|
274
|
-
:
|
275
|
-
:
|
276
|
-
:
|
277
|
-
def destroy_image(name=nil)
|
278
|
-
Middleware.sequence_destroy_image.call(
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
"user_quiet" => options[:quiet]
|
285
|
-
})
|
244
|
+
desc 'destroy_image FUZZY_NAME', 'Destroy an image'
|
245
|
+
method_option 'id',
|
246
|
+
type: :string,
|
247
|
+
aliases: '-i',
|
248
|
+
desc: 'The ID of the image.'
|
249
|
+
method_option 'name',
|
250
|
+
type: :string,
|
251
|
+
aliases: '-n',
|
252
|
+
desc: 'The exact name of the image'
|
253
|
+
method_option 'confirm',
|
254
|
+
type: :boolean,
|
255
|
+
aliases: ['-c', '-y'],
|
256
|
+
desc: 'Skip confirmation of the action'
|
257
|
+
def destroy_image(name = nil)
|
258
|
+
Middleware.sequence_destroy_image.call('tugboat_action' => __method__,
|
259
|
+
'user_image_id' => options[:id],
|
260
|
+
'user_image_name' => options[:name],
|
261
|
+
'user_image_fuzzy_name' => name,
|
262
|
+
'user_confirm_action' => options[:confirm],
|
263
|
+
'user_quiet' => options[:quiet])
|
286
264
|
end
|
287
265
|
|
288
|
-
desc
|
289
|
-
method_option
|
290
|
-
:
|
291
|
-
:
|
292
|
-
:
|
293
|
-
method_option
|
294
|
-
:
|
295
|
-
:
|
296
|
-
:
|
297
|
-
method_option
|
298
|
-
:
|
299
|
-
:
|
300
|
-
:
|
301
|
-
def restart(name=nil)
|
302
|
-
Middleware.sequence_restart_droplet.call(
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
|
308
|
-
"user_quiet" => options[:quiet]
|
309
|
-
})
|
266
|
+
desc 'restart FUZZY_NAME', 'Restart a droplet'
|
267
|
+
method_option 'id',
|
268
|
+
type: :string,
|
269
|
+
aliases: '-i',
|
270
|
+
desc: 'The ID of the droplet.'
|
271
|
+
method_option 'name',
|
272
|
+
type: :string,
|
273
|
+
aliases: '-n',
|
274
|
+
desc: 'The exact name of the droplet'
|
275
|
+
method_option 'hard',
|
276
|
+
type: :boolean,
|
277
|
+
aliases: '-h',
|
278
|
+
desc: 'Perform a hard restart'
|
279
|
+
def restart(name = nil)
|
280
|
+
Middleware.sequence_restart_droplet.call('tugboat_action' => __method__,
|
281
|
+
'user_droplet_id' => options[:id],
|
282
|
+
'user_droplet_name' => options[:name],
|
283
|
+
'user_droplet_hard' => options[:hard],
|
284
|
+
'user_droplet_fuzzy_name' => name,
|
285
|
+
'user_quiet' => options[:quiet])
|
310
286
|
end
|
311
287
|
|
312
|
-
desc
|
313
|
-
method_option
|
314
|
-
:
|
315
|
-
:
|
316
|
-
:
|
317
|
-
method_option
|
318
|
-
:
|
319
|
-
:
|
320
|
-
:
|
321
|
-
method_option
|
322
|
-
:
|
323
|
-
:
|
324
|
-
:
|
325
|
-
def halt(name=nil)
|
326
|
-
Middleware.sequence_halt_droplet.call(
|
327
|
-
|
328
|
-
|
329
|
-
|
330
|
-
|
331
|
-
|
332
|
-
"user_quiet" => options[:quiet]
|
333
|
-
})
|
288
|
+
desc 'halt FUZZY_NAME', 'Shutdown a droplet'
|
289
|
+
method_option 'id',
|
290
|
+
type: :string,
|
291
|
+
aliases: '-i',
|
292
|
+
desc: 'The ID of the droplet.'
|
293
|
+
method_option 'name',
|
294
|
+
type: :string,
|
295
|
+
aliases: '-n',
|
296
|
+
desc: 'The exact name of the droplet'
|
297
|
+
method_option 'hard',
|
298
|
+
type: :boolean,
|
299
|
+
aliases: '-h',
|
300
|
+
desc: 'Perform a hard shutdown'
|
301
|
+
def halt(name = nil)
|
302
|
+
Middleware.sequence_halt_droplet.call('tugboat_action' => __method__,
|
303
|
+
'user_droplet_id' => options[:id],
|
304
|
+
'user_droplet_name' => options[:name],
|
305
|
+
'user_droplet_hard' => options[:hard],
|
306
|
+
'user_droplet_fuzzy_name' => name,
|
307
|
+
'user_quiet' => options[:quiet])
|
334
308
|
end
|
335
309
|
|
336
|
-
desc
|
337
|
-
method_option
|
338
|
-
:
|
339
|
-
:
|
340
|
-
:
|
341
|
-
method_option
|
342
|
-
:
|
343
|
-
:
|
344
|
-
:
|
345
|
-
method_option
|
346
|
-
:
|
347
|
-
:
|
348
|
-
:
|
349
|
-
method_option
|
350
|
-
:
|
351
|
-
:
|
352
|
-
def info(name=nil)
|
353
|
-
Middleware.sequence_info_droplet.call(
|
354
|
-
|
355
|
-
|
356
|
-
|
357
|
-
|
358
|
-
|
359
|
-
|
360
|
-
"user_porcelain" => options[:porcelain]
|
361
|
-
})
|
310
|
+
desc 'info FUZZY_NAME [OPTIONS]', "Show a droplet's information"
|
311
|
+
method_option 'id',
|
312
|
+
type: :string,
|
313
|
+
aliases: '-i',
|
314
|
+
desc: 'The ID of the droplet.'
|
315
|
+
method_option 'name',
|
316
|
+
type: :string,
|
317
|
+
aliases: '-n',
|
318
|
+
desc: 'The exact name of the droplet'
|
319
|
+
method_option 'attribute',
|
320
|
+
type: :string,
|
321
|
+
aliases: '-a',
|
322
|
+
desc: 'The name of the attribute to print.'
|
323
|
+
method_option 'porcelain',
|
324
|
+
type: :boolean,
|
325
|
+
desc: 'Give the output in an easy-to-parse format for scripts.'
|
326
|
+
def info(name = nil)
|
327
|
+
Middleware.sequence_info_droplet.call('tugboat_action' => __method__,
|
328
|
+
'user_droplet_id' => options[:id],
|
329
|
+
'user_droplet_name' => options[:name],
|
330
|
+
'user_droplet_fuzzy_name' => name,
|
331
|
+
'user_quiet' => options[:quiet],
|
332
|
+
'user_attribute' => options[:attribute],
|
333
|
+
'user_porcelain' => options[:porcelain])
|
362
334
|
end
|
363
335
|
|
364
|
-
desc
|
365
|
-
method_option
|
366
|
-
:
|
367
|
-
:
|
368
|
-
:
|
369
|
-
method_option
|
370
|
-
:
|
371
|
-
:
|
372
|
-
:
|
373
|
-
def info_image(name=nil)
|
374
|
-
Middleware.sequence_info_image.call(
|
375
|
-
|
376
|
-
|
377
|
-
|
378
|
-
|
379
|
-
"user_quiet" => options[:quiet]
|
380
|
-
})
|
336
|
+
desc 'info_image FUZZY_NAME [OPTIONS]', "Show an image's information"
|
337
|
+
method_option 'id',
|
338
|
+
type: :string,
|
339
|
+
aliases: '-i',
|
340
|
+
desc: 'The ID of the image.'
|
341
|
+
method_option 'name',
|
342
|
+
type: :string,
|
343
|
+
aliases: '-n',
|
344
|
+
desc: 'The exact name of the image'
|
345
|
+
def info_image(name = nil)
|
346
|
+
Middleware.sequence_info_image.call('tugboat_action' => __method__,
|
347
|
+
'user_image_id' => options[:id],
|
348
|
+
'user_image_name' => options[:name],
|
349
|
+
'user_image_fuzzy_name' => name,
|
350
|
+
'user_quiet' => options[:quiet])
|
381
351
|
end
|
382
352
|
|
383
|
-
desc
|
384
|
-
method_option
|
385
|
-
:
|
386
|
-
:
|
387
|
-
:
|
388
|
-
method_option
|
389
|
-
:
|
390
|
-
:
|
391
|
-
:
|
392
|
-
def snapshot(snapshot_name, name=nil)
|
393
|
-
Middleware.sequence_snapshot_droplet.call(
|
394
|
-
|
395
|
-
|
396
|
-
|
397
|
-
|
398
|
-
|
399
|
-
"user_quiet" => options[:quiet]
|
400
|
-
})
|
353
|
+
desc 'snapshot SNAPSHOT_NAME FUZZY_NAME [OPTIONS]', 'Queue a snapshot of the droplet.'
|
354
|
+
method_option 'id',
|
355
|
+
type: :string,
|
356
|
+
aliases: '-i',
|
357
|
+
desc: 'The ID of the droplet.'
|
358
|
+
method_option 'name',
|
359
|
+
type: :string,
|
360
|
+
aliases: '-n',
|
361
|
+
desc: 'The exact name of the droplet'
|
362
|
+
def snapshot(snapshot_name, name = nil)
|
363
|
+
Middleware.sequence_snapshot_droplet.call('tugboat_action' => __method__,
|
364
|
+
'user_droplet_id' => options[:id],
|
365
|
+
'user_droplet_name' => options[:name],
|
366
|
+
'user_droplet_fuzzy_name' => name,
|
367
|
+
'user_snapshot_name' => snapshot_name,
|
368
|
+
'user_quiet' => options[:quiet])
|
401
369
|
end
|
402
370
|
|
403
|
-
desc
|
371
|
+
desc 'keys', 'Show available SSH keys'
|
404
372
|
def keys
|
405
|
-
Middleware.sequence_ssh_keys.call(
|
406
|
-
"tugboat_action" => __method__,
|
407
|
-
})
|
373
|
+
Middleware.sequence_ssh_keys.call('tugboat_action' => __method__)
|
408
374
|
end
|
409
375
|
|
410
|
-
desc
|
376
|
+
desc 'add-key KEY-NAME', 'Upload an ssh public key to DigitalOcean, to be assigned to a droplet later'
|
411
377
|
long_desc "This uploads a ssh-key to DigitalOcean, which you can then assign to a droplet at
|
412
378
|
creation time so you can connect to it with the key rather than a password.
|
413
379
|
"
|
414
|
-
method_option
|
415
|
-
:
|
416
|
-
:
|
417
|
-
:
|
418
|
-
method_option
|
419
|
-
:
|
420
|
-
:
|
421
|
-
:
|
380
|
+
method_option 'key',
|
381
|
+
type: :string,
|
382
|
+
aliases: '-k',
|
383
|
+
desc: 'The string of the key'
|
384
|
+
method_option 'path',
|
385
|
+
type: :string,
|
386
|
+
aliases: '-p',
|
387
|
+
desc: 'The path to the ssh key'
|
422
388
|
def add_key(name)
|
423
|
-
Middleware.sequence_add_key.call(
|
424
|
-
|
425
|
-
|
426
|
-
|
427
|
-
|
428
|
-
"user_quiet" => options[:quiet]
|
429
|
-
})
|
389
|
+
Middleware.sequence_add_key.call('tugboat_action' => __method__,
|
390
|
+
'add_key_name' => name,
|
391
|
+
'add_key_pub_key' => options[:key],
|
392
|
+
'add_key_file_path' => options[:path],
|
393
|
+
'user_quiet' => options[:quiet])
|
430
394
|
end
|
431
395
|
|
432
|
-
desc
|
396
|
+
desc 'regions', 'Show regions'
|
433
397
|
def regions
|
434
|
-
Middleware.sequence_regions.call(
|
435
|
-
|
436
|
-
"user_quiet" => options[:quiet]
|
437
|
-
})
|
398
|
+
Middleware.sequence_regions.call('tugboat_action' => __method__,
|
399
|
+
'user_quiet' => options[:quiet])
|
438
400
|
end
|
439
401
|
|
440
|
-
desc
|
402
|
+
desc 'version', 'Show version'
|
441
403
|
def version
|
442
404
|
say "Tugboat #{Tugboat::VERSION}"
|
443
405
|
end
|
444
406
|
|
445
|
-
desc
|
407
|
+
desc 'sizes', 'Show available droplet sizes'
|
446
408
|
def sizes
|
447
|
-
Middleware.sequence_sizes.call(
|
448
|
-
|
449
|
-
"user_quiet" => options[:quiet]
|
450
|
-
})
|
409
|
+
Middleware.sequence_sizes.call('tugboat_action' => __method__,
|
410
|
+
'user_quiet' => options[:quiet])
|
451
411
|
end
|
452
412
|
|
453
|
-
desc
|
454
|
-
method_option
|
455
|
-
:
|
456
|
-
:
|
457
|
-
:
|
458
|
-
method_option
|
459
|
-
:
|
460
|
-
:
|
461
|
-
:
|
462
|
-
def start(name=nil)
|
463
|
-
Middleware.sequence_start_droplet.call(
|
464
|
-
|
465
|
-
|
466
|
-
|
467
|
-
|
468
|
-
"user_quiet" => options[:quiet]
|
469
|
-
})
|
413
|
+
desc 'start FUZZY_NAME', 'Start a droplet'
|
414
|
+
method_option 'id',
|
415
|
+
type: :string,
|
416
|
+
aliases: '-i',
|
417
|
+
desc: 'The ID of the droplet.'
|
418
|
+
method_option 'name',
|
419
|
+
type: :string,
|
420
|
+
aliases: '-n',
|
421
|
+
desc: 'The exact name of the droplet'
|
422
|
+
def start(name = nil)
|
423
|
+
Middleware.sequence_start_droplet.call('tugboat_action' => __method__,
|
424
|
+
'user_droplet_id' => options[:id],
|
425
|
+
'user_droplet_name' => options[:name],
|
426
|
+
'user_droplet_fuzzy_name' => name,
|
427
|
+
'user_quiet' => options[:quiet])
|
470
428
|
end
|
471
429
|
|
472
|
-
desc
|
473
|
-
method_option
|
474
|
-
:
|
475
|
-
:
|
476
|
-
:
|
477
|
-
method_option
|
478
|
-
:
|
479
|
-
:
|
480
|
-
:
|
481
|
-
method_option
|
482
|
-
:
|
483
|
-
:
|
484
|
-
:
|
485
|
-
:
|
486
|
-
def resize(name=nil)
|
487
|
-
Middleware.sequence_resize_droplet.call(
|
488
|
-
|
489
|
-
|
490
|
-
|
491
|
-
|
492
|
-
|
493
|
-
"user_quiet" => options[:quiet]
|
494
|
-
})
|
430
|
+
desc 'resize FUZZY_NAME', 'Resize a droplet'
|
431
|
+
method_option 'id',
|
432
|
+
type: :numeric,
|
433
|
+
aliases: '-i',
|
434
|
+
desc: 'The ID of the droplet.'
|
435
|
+
method_option 'name',
|
436
|
+
type: :string,
|
437
|
+
aliases: '-n',
|
438
|
+
desc: 'The exact name of the droplet'
|
439
|
+
method_option 'size',
|
440
|
+
type: :string,
|
441
|
+
aliases: '-s',
|
442
|
+
required: true,
|
443
|
+
desc: 'The size slug to resize the droplet to'
|
444
|
+
def resize(name = nil)
|
445
|
+
Middleware.sequence_resize_droplet.call('tugboat_action' => __method__,
|
446
|
+
'user_droplet_id' => options[:id],
|
447
|
+
'user_droplet_name' => options[:name],
|
448
|
+
'user_droplet_size' => options[:size],
|
449
|
+
'user_droplet_fuzzy_name' => name,
|
450
|
+
'user_quiet' => options[:quiet])
|
495
451
|
end
|
496
452
|
|
497
|
-
desc
|
498
|
-
method_option
|
499
|
-
:
|
500
|
-
:
|
501
|
-
:
|
502
|
-
method_option
|
503
|
-
:
|
504
|
-
:
|
505
|
-
:
|
506
|
-
|
507
|
-
def password_reset(name=nil)
|
508
|
-
Middleware.sequence_password_reset.call(
|
509
|
-
|
510
|
-
|
511
|
-
|
512
|
-
|
513
|
-
"user_quiet" => options[:quiet]
|
514
|
-
})
|
453
|
+
desc 'password-reset FUZZY_NAME', 'Reset root password'
|
454
|
+
method_option 'id',
|
455
|
+
type: :numeric,
|
456
|
+
aliases: '-i',
|
457
|
+
desc: 'The ID of the droplet.'
|
458
|
+
method_option 'name',
|
459
|
+
type: :string,
|
460
|
+
aliases: '-n',
|
461
|
+
desc: 'The exact name of the droplet'
|
462
|
+
|
463
|
+
def password_reset(name = nil)
|
464
|
+
Middleware.sequence_password_reset.call('tugboat_action' => __method__,
|
465
|
+
'user_droplet_id' => options[:id],
|
466
|
+
'user_droplet_name' => options[:name],
|
467
|
+
'user_droplet_fuzzy_name' => name,
|
468
|
+
'user_quiet' => options[:quiet])
|
515
469
|
end
|
516
470
|
|
517
|
-
desc
|
518
|
-
method_option
|
519
|
-
:
|
520
|
-
:
|
521
|
-
:
|
522
|
-
method_option
|
523
|
-
:
|
524
|
-
:
|
525
|
-
:
|
526
|
-
method_option
|
527
|
-
:
|
528
|
-
:
|
529
|
-
:
|
530
|
-
:
|
531
|
-
|
532
|
-
def wait(name=nil)
|
533
|
-
Middleware.sequence_wait.call(
|
534
|
-
|
535
|
-
|
536
|
-
|
537
|
-
|
538
|
-
|
539
|
-
"user_quiet" => options[:quiet]
|
540
|
-
})
|
471
|
+
desc 'wait FUZZY_NAME', 'Wait for a droplet to reach a state'
|
472
|
+
method_option 'id',
|
473
|
+
type: :numeric,
|
474
|
+
aliases: '-i',
|
475
|
+
desc: 'The ID of the droplet.'
|
476
|
+
method_option 'name',
|
477
|
+
type: :string,
|
478
|
+
aliases: '-n',
|
479
|
+
desc: 'The exact name of the droplet'
|
480
|
+
method_option 'state',
|
481
|
+
type: :string,
|
482
|
+
aliases: '-s',
|
483
|
+
default: 'active',
|
484
|
+
desc: 'The state of the droplet to wait for'
|
485
|
+
|
486
|
+
def wait(name = nil)
|
487
|
+
Middleware.sequence_wait.call('tugboat_action' => __method__,
|
488
|
+
'user_droplet_id' => options[:id],
|
489
|
+
'user_droplet_name' => options[:name],
|
490
|
+
'user_droplet_desired_state' => options[:state],
|
491
|
+
'user_droplet_fuzzy_name' => name,
|
492
|
+
'user_quiet' => options[:quiet])
|
541
493
|
end
|
542
494
|
end
|
543
495
|
end
|
544
|
-
|
545
|
-
|