kuby-digitalocean 0.2.0 → 0.3.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
  SHA256:
3
- metadata.gz: 92d5b8adbac3de38fe19948d318e2115ea5cb50baefe6c92ce9313fadf5b8121
4
- data.tar.gz: 061b2b1a0393882715db8eb4c9e9b6cd6c2adb0f854103c74ac9864fe5a058e4
3
+ metadata.gz: eb912827029d83236bbea429358b6f028a91ca5417df4f7f51f295f1f793c815
4
+ data.tar.gz: 6322031522465f144e22815daa4ed8a93dfc395e81bf92296e31c15121152a3d
5
5
  SHA512:
6
- metadata.gz: af8e7e8e27826a8cf1802149faf8c69be696d9c23868b225ca8ad388d632780a5dded023a584e419f8b6a9034b2bb4c19b47f7a154591b3162efcd141006bc69
7
- data.tar.gz: c11905801f983323ae036f35e8f9b1e10f7d6ee9d137c1f431f12dac86be50faef3b8236a3262b77314a6fc4a33f1172ea86dea2d5218f392916df0a4a988dd0
6
+ metadata.gz: f1c5ac023e64806f383c278fe847ca47f6b7d060ead04b28ddcd0bfe643e2b3e1150e5cfb7fbfed940ec0251fbfbf5f6c6d09a9a8bde8a4149f125d88261bc80
7
+ data.tar.gz: c2ff355c31213b766c0ee2267327752c79915abd29de35ed6ad0d6c804103002a38f104a35124a540d61a7b1dc3a9ac685c2a8d8ec8024c9a6806f72390b1448
@@ -1,3 +1,8 @@
1
+ ## 0.3.0
2
+ * Refresh kubeconfig in more places.
3
+ - Before setup
4
+ - Before deploy
5
+
1
6
  ## 0.2.0
2
7
  * Refresh kubeconfig earlier and more often so it's ready during setup.
3
8
 
@@ -0,0 +1,36 @@
1
+ ## kuby-digitalocean
2
+
3
+ DigitalOcean provider for [Kuby](https://github.com/getkuby/kuby-core).
4
+
5
+ ## Intro
6
+
7
+ In Kuby parlance, a "provider" is an [adapter](https://en.wikipedia.org/wiki/Adapter_pattern) that enables Kuby to deploy apps to a specific cloud provider. In this case, we're talking about [DigitalOcean](https://www.digitalocean.com/).
8
+
9
+ All providers adhere to a specific interface, meaning you can swap out one provider for another without having to change your code.
10
+
11
+ ## Usage
12
+
13
+ Enable the DigitalOcean provider like so:
14
+
15
+ ```ruby
16
+ Kuby.define(:production) do
17
+ kubernetes do
18
+
19
+ provider :digitalocean do
20
+ access_token 'my-digitalocean-access-token'
21
+ cluster_id 'my-cluster-id'
22
+ end
23
+
24
+ end
25
+ end
26
+ ```
27
+
28
+ Once configured, you should be able to run all the Kuby rake tasks as you would with any provider.
29
+
30
+ ## License
31
+
32
+ Licensed under the MIT license. See LICENSE for details.
33
+
34
+ ## Authors
35
+
36
+ * Cameron C. Dutro: http://github.com/camertron
@@ -1,6 +1,7 @@
1
1
  require 'kuby'
2
2
  require 'droplet_kit'
3
3
  require 'fileutils'
4
+ require 'tmpdir'
4
5
 
5
6
  module Kuby
6
7
  module DigitalOcean
@@ -15,9 +16,13 @@ module Kuby
15
16
  end
16
17
 
17
18
  def kubeconfig_path
18
- @kubeconfig_path ||= kubeconfig_dir.join(
19
- "#{definition.app_name.downcase}-kubeconfig.yaml"
20
- ).to_s
19
+ @kubeconfig_path ||= File.join(
20
+ kubeconfig_dir, "#{definition.app_name.downcase}-kubeconfig.yaml"
21
+ )
22
+ end
23
+
24
+ def before_setup
25
+ refresh_kubeconfig
21
26
  end
22
27
 
23
28
  def after_setup
@@ -48,10 +53,16 @@ module Kuby
48
53
  end
49
54
  end
50
55
 
51
- def after_configuration
56
+ def before_deploy(*)
52
57
  refresh_kubeconfig
53
58
  end
54
59
 
60
+ def after_initialize
61
+ kubernetes_cli.before_execute do
62
+ refresh_kubeconfig
63
+ end
64
+ end
65
+
55
66
  def storage_class_name
56
67
  STORAGE_CLASS_NAME
57
68
  end
@@ -83,8 +94,8 @@ module Kuby
83
94
  end
84
95
 
85
96
  def kubeconfig_dir
86
- @kubeconfig_dir ||= definition.app.root.join(
87
- 'tmp', 'kuby-digitalocean'
97
+ @kubeconfig_dir ||= File.join(
98
+ Dir.tmpdir, 'kuby-digitalocean'
88
99
  )
89
100
  end
90
101
  end
@@ -1,5 +1,5 @@
1
1
  module Kuby
2
2
  module DigitalOcean
3
- VERSION = '0.2.0'.freeze
3
+ VERSION = '0.3.0'.freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kuby-digitalocean
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Cameron Dutro
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-06-09 00:00:00.000000000 Z
11
+ date: 2020-08-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: droplet_kit
@@ -48,6 +48,7 @@ files:
48
48
  - CHANGELOG.md
49
49
  - Gemfile
50
50
  - LICENSE
51
+ - README.md
51
52
  - Rakefile
52
53
  - kuby-digitalocean.gemspec
53
54
  - lib/kuby/digitalocean.rb
@@ -57,7 +58,7 @@ files:
57
58
  homepage: http://github.com/getkuby/kuby-digitalocean
58
59
  licenses: []
59
60
  metadata: {}
60
- post_install_message:
61
+ post_install_message:
61
62
  rdoc_options: []
62
63
  require_paths:
63
64
  - lib
@@ -72,8 +73,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
72
73
  - !ruby/object:Gem::Version
73
74
  version: '0'
74
75
  requirements: []
75
- rubygems_version: 3.0.6
76
- signing_key:
76
+ rubygems_version: 3.1.4
77
+ signing_key:
77
78
  specification_version: 4
78
79
  summary: DigitalOcean provider for Kuby.
79
80
  test_files: []