kontena-plugin-digitalocean 0.3.1.rc1 → 0.3.1

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: 159d041998037905df8bfaf653d921910f8ba2df
4
- data.tar.gz: b49274c2e74cace9384aa6c25fde76e6c19edb41
3
+ metadata.gz: 0b360ca30054c74ad16332d725ce999af892cf52
4
+ data.tar.gz: 275a49354f7c585ba5f5e13f8292a1308b4ad907
5
5
  SHA512:
6
- metadata.gz: 88ebcc12587efa3c1edbd14f249dc6e5a4b6dbe051eb6f5e7d27a6ca2bbcf81f8941e6928cc148e4be37eeaa4e059451bf83a2cc812fbcb8439765e6feb3f097
7
- data.tar.gz: 4608d8bc37fb630b12f91316a05a704106fa89717d106a64ae912438978cbf94dddb18777dc2476892270a4adc3ea2ed10a4c4ee67fb5b812015667deb0974e8
6
+ metadata.gz: 93ae933981067d120c5823fa9b8f18ba942ae6c294c2aaed9dae89b1540b39116c1e8e2f66995ff23c3d62bf76f920cb3064cb6eea7039428bde97a7bf784d44
7
+ data.tar.gz: 5937a77e6584f1f4259e96aa55cc98c4224872f6877bc08a8f398dafda6f997fc7f537e56a617cf7cb99f508727b602d8caefd282755fb948c5b4c5d513ca21c
@@ -1,7 +1,7 @@
1
1
  module Kontena
2
2
  module Plugin
3
3
  module DigitalOcean
4
- VERSION = "0.3.1.rc1"
4
+ VERSION = "0.3.1"
5
5
  end
6
6
  end
7
7
  end
@@ -1,5 +1,4 @@
1
- require 'securerandom'
2
- require_relative '../prompts'
1
+ require 'kontena/plugin/digital_ocean/prompts'
3
2
 
4
3
  module Kontena::Plugin::DigitalOcean::Master
5
4
  class CreateCommand < Kontena::Command
@@ -17,13 +16,14 @@ module Kontena::Plugin::DigitalOcean::Master
17
16
  option "--mongodb-uri", "URI", "External MongoDB uri (optional)"
18
17
  option "--version", "VERSION", "Define installed Kontena version", default: 'latest'
19
18
 
20
-
21
19
  def execute
22
20
  suppress_warnings # until DO merges resource_kit pr #32
23
21
  do_token = ask_do_token
24
22
 
25
- require_relative '../../../machine/digital_ocean'
23
+ require 'securerandom'
24
+ require 'kontena/machine/digital_ocean'
26
25
 
26
+ do_token = ask_do_token
27
27
  do_region = ask_droplet_region(do_token)
28
28
  do_size = ask_droplet_size(do_token, do_region)
29
29
  do_ssh_key_id = ask_ssh_key(do_token)
@@ -1,3 +1,5 @@
1
+ require 'kontena/plugin/digital_ocean/prompts'
2
+
1
3
  module Kontena::Plugin::DigitalOcean::Master
2
4
  class TerminateCommand < Kontena::Command
3
5
  include Kontena::Cli::Common
@@ -10,10 +12,9 @@ module Kontena::Plugin::DigitalOcean::Master
10
12
 
11
13
  def execute
12
14
  suppress_warnings # until DO merges resource_kit pr #32
15
+ require 'kontena/machine/digital_ocean'
13
16
  do_token = ask_do_token
14
17
  confirm_command(name) unless forced?
15
-
16
- require_relative '../../../machine/digital_ocean'
17
18
  destroyer = destroyer(do_token)
18
19
  destroyer.run!(name)
19
20
  ensure
@@ -1,11 +1,4 @@
1
- require_relative 'master/create_command'
2
- require_relative 'master/terminate_command'
3
-
4
1
  class Kontena::Plugin::DigitalOcean::MasterCommand < Kontena::Command
5
-
6
- subcommand "create", "Create a new master to DigitalOcean", Kontena::Plugin::DigitalOcean::Master::CreateCommand
7
- subcommand "terminate", "Terminate DigitalOcean master", Kontena::Plugin::DigitalOcean::Master::TerminateCommand
8
-
9
- def execute
10
- end
2
+ subcommand "create", "Create a new master to DigitalOcean", load_subcommand('kontena/plugin/digital_ocean/master/create_command')
3
+ subcommand "terminate", "Terminate DigitalOcean master", load_subcommand('kontena/plugin/digital_ocean/master/terminate_command')
11
4
  end
@@ -1,13 +1,5 @@
1
- require_relative 'nodes/create_command'
2
- require_relative 'nodes/restart_command'
3
- require_relative 'nodes/terminate_command'
4
-
5
1
  class Kontena::Plugin::DigitalOcean::NodeCommand < Kontena::Command
6
-
7
- subcommand "create", "Create a new node to DigitalOcean", Kontena::Plugin::DigitalOcean::Nodes::CreateCommand
8
- subcommand "restart", "Restart DigitalOcean node", Kontena::Plugin::DigitalOcean::Nodes::RestartCommand
9
- subcommand "terminate", "Terminate DigitalOcean node", Kontena::Plugin::DigitalOcean::Nodes::TerminateCommand
10
-
11
- def execute
12
- end
2
+ subcommand "create", "Create a new node to DigitalOcean", load_subcommand('kontena/plugin/digital_ocean/nodes/create_command')
3
+ subcommand "restart", "Restart DigitalOcean node", load_subcommand('kontena/plugin/digital_ocean/nodes/restart_command')
4
+ subcommand "terminate", "Terminate DigitalOcean node", load_subcommand('kontena/plugin/digital_ocean/nodes/terminate_command')
13
5
  end
@@ -1,4 +1,4 @@
1
- require_relative '../prompts'
1
+ require 'kontena/plugin/digital_ocean/prompts'
2
2
 
3
3
  module Kontena::Plugin::DigitalOcean::Nodes
4
4
  class CreateCommand < Kontena::Command
@@ -17,13 +17,11 @@ module Kontena::Plugin::DigitalOcean::Nodes
17
17
 
18
18
  def execute
19
19
  suppress_warnings # until DO merges resource_kit pr #32
20
+ require 'kontena/machine/digital_ocean'
20
21
  require_api_url
21
22
  require_current_grid
22
23
 
23
24
  do_token = ask_do_token
24
-
25
- require_relative '../../../machine/digital_ocean'
26
-
27
25
  do_region = ask_droplet_region(do_token)
28
26
  coreos_channel = self.channel || ask_channel
29
27
  do_size = ask_droplet_size(do_token, do_region)
@@ -1,4 +1,4 @@
1
- require_relative '../prompts'
1
+ require 'kontena/plugin/digital_ocean/prompts'
2
2
 
3
3
  module Kontena::Plugin::DigitalOcean::Nodes
4
4
  class RestartCommand < Kontena::Command
@@ -11,12 +11,11 @@ module Kontena::Plugin::DigitalOcean::Nodes
11
11
 
12
12
  def execute
13
13
  suppress_warnings # until DO merges resource_kit pr #32
14
+ require 'kontena/machine/digital_ocean'
14
15
  require_api_url
15
16
  require_current_grid
16
17
  do_token = ask_do_token
17
18
 
18
- require_relative '../../../machine/digital_ocean'
19
-
20
19
  node_name = ask_node(require_token)
21
20
  client = DropletKit::Client.new(access_token: do_token)
22
21
  droplet = client.droplets.all.find{|d| d.name == node_name}
@@ -1,4 +1,4 @@
1
- require_relative '../prompts'
1
+ require 'kontena/plugin/digital_ocean/prompts'
2
2
 
3
3
  module Kontena::Plugin::DigitalOcean::Nodes
4
4
  class TerminateCommand < Kontena::Command
@@ -12,6 +12,7 @@ module Kontena::Plugin::DigitalOcean::Nodes
12
12
 
13
13
  def execute
14
14
  suppress_warnings # until DO merges resource_kit pr #32
15
+ require 'kontena/machine/digital_ocean'
15
16
  require_api_url
16
17
  require_current_grid
17
18
  token = require_token
@@ -19,7 +20,6 @@ module Kontena::Plugin::DigitalOcean::Nodes
19
20
  do_token = ask_do_token
20
21
  confirm_command(node_name) unless forced?
21
22
 
22
- require_relative '../../../machine/digital_ocean'
23
23
  grid = client(require_token).get("grids/#{current_grid}")
24
24
  destroyer = destroyer(client(token), do_token)
25
25
  destroyer.run!(grid, node_name)
@@ -18,7 +18,7 @@ module Kontena::Plugin::DigitalOcean::Prompts
18
18
  public_key = File.read(self.ssh_key).strip
19
19
  else
20
20
  keys = manager.list
21
- key_id = :new
21
+ key = :new
22
22
 
23
23
  default_path = File.join(Dir.home, '.ssh', 'id_rsa.pub')
24
24
  default = File.exist?(default_path) ? File.read(default_path).strip : nil
@@ -1,11 +1,4 @@
1
- require_relative 'digital_ocean/master_command'
2
- require_relative 'digital_ocean/node_command'
3
-
4
1
  class Kontena::Plugin::DigitalOceanCommand < Kontena::Command
5
-
6
- subcommand 'master', 'DigitalOcean master related commands', Kontena::Plugin::DigitalOcean::MasterCommand
7
- subcommand 'node', 'DigitalOcean node related commands', Kontena::Plugin::DigitalOcean::NodeCommand
8
-
9
- def execute
10
- end
2
+ subcommand 'master', 'DigitalOcean master related commands', load_subcommand('kontena/plugin/digital_ocean/master_command')
3
+ subcommand 'node', 'DigitalOcean node related commands', load_subcommand('kontena/plugin/digital_ocean/node_command')
11
4
  end
@@ -1,5 +1,5 @@
1
1
  require 'kontena_cli'
2
- require_relative 'kontena/plugin/digital_ocean'
3
- require_relative 'kontena/plugin/digital_ocean_command'
2
+ require 'kontena/plugin/digital_ocean'
3
+ require 'kontena/cli/subcommand_loader'
4
4
 
5
- Kontena::MainCommand.register("digitalocean", "DigitalOcean specific commands", Kontena::Plugin::DigitalOceanCommand)
5
+ Kontena::MainCommand.register("digitalocean", "DigitalOcean specific commands", Kontena::Cli::SubcommandLoader.new('kontena/plugin/digital_ocean_command'))
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kontena-plugin-digitalocean
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1.rc1
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kontena, Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-08-03 00:00:00.000000000 Z
11
+ date: 2017-08-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: kontena-cli
@@ -129,9 +129,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
129
129
  version: '0'
130
130
  required_rubygems_version: !ruby/object:Gem::Requirement
131
131
  requirements:
132
- - - ">"
132
+ - - ">="
133
133
  - !ruby/object:Gem::Version
134
- version: 1.3.1
134
+ version: '0'
135
135
  requirements: []
136
136
  rubyforge_project:
137
137
  rubygems_version: 2.6.11