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 +4 -4
- data/CHANGELOG.md +5 -0
- data/README.md +36 -0
- data/lib/kuby/digitalocean/provider.rb +17 -6
- data/lib/kuby/digitalocean/version.rb +1 -1
- metadata +7 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: eb912827029d83236bbea429358b6f028a91ca5417df4f7f51f295f1f793c815
|
4
|
+
data.tar.gz: 6322031522465f144e22815daa4ed8a93dfc395e81bf92296e31c15121152a3d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f1c5ac023e64806f383c278fe847ca47f6b7d060ead04b28ddcd0bfe643e2b3e1150e5cfb7fbfed940ec0251fbfbf5f6c6d09a9a8bde8a4149f125d88261bc80
|
7
|
+
data.tar.gz: c2ff355c31213b766c0ee2267327752c79915abd29de35ed6ad0d6c804103002a38f104a35124a540d61a7b1dc3a9ac685c2a8d8ec8024c9a6806f72390b1448
|
data/CHANGELOG.md
CHANGED
data/README.md
ADDED
@@ -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 ||=
|
19
|
-
"#{definition.app_name.downcase}-kubeconfig.yaml"
|
20
|
-
)
|
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
|
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 ||=
|
87
|
-
|
97
|
+
@kubeconfig_dir ||= File.join(
|
98
|
+
Dir.tmpdir, 'kuby-digitalocean'
|
88
99
|
)
|
89
100
|
end
|
90
101
|
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.
|
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
|
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.
|
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: []
|