kubec 0.3.6 → 0.4.0
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/lib/kubec/application.rb +13 -2
- data/lib/kubec/config/downloader.rb +2 -2
- data/lib/kubec/kubernetes.rb +10 -1
- data/lib/kubec/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 9620eb2542b711dd56a019147854a504dde57a9b
|
|
4
|
+
data.tar.gz: '04458cc7fa88ece1a99807e1885a09bef6580cfc'
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 3e2950f186e92784041d4615e0b687b076bebf0b680ee7f9667cb59671a54ae16bf90faa4c52205997d320347bc556d31181856068efdbbf5b1dfd221c3a9ee2
|
|
7
|
+
data.tar.gz: e14f6d89ec923627ef28689293071b5a9a3ee4eb8244ef97d60184312f30aa957c7b2df1f63851ea92f3b55f7a15c546bcbfa3c0fe08875411b22f92047ab14c
|
data/lib/kubec/application.rb
CHANGED
|
@@ -68,18 +68,19 @@ module Kubec
|
|
|
68
68
|
end
|
|
69
69
|
|
|
70
70
|
def sort_options(options)
|
|
71
|
-
supported_options = %w[tasks]
|
|
71
|
+
supported_options = %w[tasks trace verbose]
|
|
72
72
|
|
|
73
73
|
options.select! do |(switch, *)|
|
|
74
74
|
switch =~ /--#{Regexp.union(supported_options)}/
|
|
75
75
|
end
|
|
76
76
|
|
|
77
|
-
super.push(debug, version)
|
|
77
|
+
super.push(debug, dry_run, version)
|
|
78
78
|
end
|
|
79
79
|
|
|
80
80
|
def setup_options
|
|
81
81
|
options.rakelib = ['rakelib']
|
|
82
82
|
options.debug = false
|
|
83
|
+
options.dry = false
|
|
83
84
|
options.trace_output = STDERR
|
|
84
85
|
end
|
|
85
86
|
|
|
@@ -97,6 +98,16 @@ module Kubec
|
|
|
97
98
|
]
|
|
98
99
|
end
|
|
99
100
|
|
|
101
|
+
def dry_run
|
|
102
|
+
[
|
|
103
|
+
'--[no-]dry',
|
|
104
|
+
'Run kubernetes command in dry mode',
|
|
105
|
+
lambda do |value|
|
|
106
|
+
options.dry = value
|
|
107
|
+
end
|
|
108
|
+
]
|
|
109
|
+
end
|
|
110
|
+
|
|
100
111
|
def version
|
|
101
112
|
[
|
|
102
113
|
'--version', '-V',
|
|
@@ -43,9 +43,9 @@ module Kubec
|
|
|
43
43
|
# TODO: Refactor
|
|
44
44
|
def path_with_stage(path)
|
|
45
45
|
path.split('.').tap do |ary|
|
|
46
|
-
ext = ary.pop
|
|
46
|
+
ext = ary.pop unless ary.first.empty?
|
|
47
47
|
ary.push(fetch(:stage, :staging))
|
|
48
|
-
ary.push(ext)
|
|
48
|
+
ary.push(ext) if ext
|
|
49
49
|
end.join('.')
|
|
50
50
|
end
|
|
51
51
|
end
|
data/lib/kubec/kubernetes.rb
CHANGED
|
@@ -26,7 +26,16 @@ module Kubec
|
|
|
26
26
|
return unless APPLYABLE_TYPES.include?(type.to_sym)
|
|
27
27
|
return debug(type) if Rake.application.options.debug
|
|
28
28
|
# TODO: Replace with RESTful API
|
|
29
|
-
|
|
29
|
+
execute(type)
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
def cmd
|
|
33
|
+
return 'kubectl apply --dry-run -f -' if Rake.application.options.dry
|
|
34
|
+
'kubectl apply -f -'
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
def execute(type)
|
|
38
|
+
IO.popen(cmd, 'r+') do |io|
|
|
30
39
|
io.write convert_to_json(instance.send(type))
|
|
31
40
|
io.close_write
|
|
32
41
|
puts io.gets
|
data/lib/kubec/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: kubec
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.4.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- 5xRuby
|
|
@@ -9,7 +9,7 @@ authors:
|
|
|
9
9
|
autorequire:
|
|
10
10
|
bindir: exe
|
|
11
11
|
cert_chain: []
|
|
12
|
-
date: 2018-01-
|
|
12
|
+
date: 2018-01-22 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
15
|
name: colorize
|