kuber_kit 0.6.1 → 0.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/rspec.yml +1 -1
- data/.gitignore +2 -1
- data/.ruby-version +1 -1
- data/CHANGELOG.md +13 -0
- data/kuber_kit.gemspec +13 -3
- data/lib/kuber_kit/actions/configuration_loader.rb +6 -2
- data/lib/kuber_kit/core/context_helper/context_vars.rb +41 -12
- data/lib/kuber_kit/env_file_reader/reader.rb +2 -2
- data/lib/kuber_kit/service_deployer/deployer.rb +2 -2
- data/lib/kuber_kit/template_reader/reader.rb +2 -2
- data/lib/kuber_kit/ui/simple.rb +1 -0
- data/lib/kuber_kit/version.rb +1 -1
- metadata +12 -13
- data/Gemfile.lock +0 -84
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d5c29f15c515fba96ece8e78533644f3a43a1d2549302599f745c676dedd47c5
|
4
|
+
data.tar.gz: dccbbc6c69d0cdfbb27dfb3f9ded0bdd1efb3609f1b8ba5fe1580d4cf65ed42b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 110f8df5c9fa5767ee82ce03b5e482b96ba43f0394a7cc8349888df086adb663a68858fe49154c83913fc7a8be935a0494e84cf617a332f69e4553edc234024c
|
7
|
+
data.tar.gz: c1800c82bb31e7b17d12b033317ebffa554eee238c66d10141603ad42817ceb314cfd12cf01b4ccc010f701e9a3424a72ed10f2ed2611c7339e9a83d5ae45821
|
data/.github/workflows/rspec.yml
CHANGED
data/.gitignore
CHANGED
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.
|
1
|
+
2.6.8
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,16 @@
|
|
1
|
+
**0.7.0**
|
2
|
+
- Added Ruby 3.0 support
|
3
|
+
|
4
|
+
**0.6.4**
|
5
|
+
- Improve context vars, allow checking if variable is defined
|
6
|
+
|
7
|
+
**0.6.3**
|
8
|
+
- Fix updating artifacts when there is only local artifacts
|
9
|
+
|
10
|
+
**0.6.2**
|
11
|
+
- Added an ability to return build vars as a hash value.
|
12
|
+
- Skip local artifacts while updating configuration, it sometimes produce an error
|
13
|
+
|
1
14
|
**0.6.1**
|
2
15
|
- Improve performance of artifacts update by updating in threads.
|
3
16
|
- Added an ability to define default services
|
data/kuber_kit.gemspec
CHANGED
@@ -23,15 +23,25 @@ Gem::Specification.new do |spec|
|
|
23
23
|
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
24
24
|
spec.require_paths = ["lib"]
|
25
25
|
|
26
|
-
|
27
|
-
|
26
|
+
if RUBY_VERSION >= '3.0.0'
|
27
|
+
spec.add_dependency "contracts", '0.17.0'
|
28
|
+
else
|
29
|
+
spec.add_dependency "contracts", '0.16.0'
|
30
|
+
end
|
31
|
+
|
32
|
+
if RUBY_VERSION >= '2.6.0'
|
33
|
+
spec.add_dependency "dry-auto_inject", "~> 0.8.0"
|
34
|
+
else
|
35
|
+
spec.add_dependency "dry-auto_inject", "~> 0.7.0"
|
36
|
+
end
|
37
|
+
|
28
38
|
spec.add_dependency "thor"
|
29
39
|
spec.add_dependency "cli-ui"
|
30
40
|
spec.add_dependency "net-ssh"
|
31
41
|
spec.add_dependency "tty-prompt"
|
32
42
|
spec.add_dependency "dry-container", "~> 0.7.2"
|
33
43
|
|
34
|
-
spec.add_development_dependency "bundler", "~>
|
44
|
+
spec.add_development_dependency "bundler", "~> 2.2"
|
35
45
|
spec.add_development_dependency "rake", "~> 10.0"
|
36
46
|
spec.add_development_dependency "rspec", "~> 3.0"
|
37
47
|
spec.add_development_dependency "pry"
|
@@ -99,10 +99,14 @@ class KuberKit::Actions::ConfigurationLoader
|
|
99
99
|
end
|
100
100
|
|
101
101
|
def update_artifacts(artifacts)
|
102
|
-
|
102
|
+
# Skip local artifacts, they sometimes produce error in CLI::UI::SpinGroup task,
|
103
|
+
# because the task is executed too quickly
|
104
|
+
not_local_artifacts = artifacts.reject{ |a| a.is_a?(KuberKit::Core::Artifacts::Local) }
|
105
|
+
|
106
|
+
return unless not_local_artifacts.any?
|
103
107
|
|
104
108
|
artifact_task_group = ui.create_task_group
|
105
|
-
|
109
|
+
not_local_artifacts.each do |artifact|
|
106
110
|
artifact_task_group.add("Updating #{artifact.name.to_s.yellow}") do |task|
|
107
111
|
artifact_updater.update(local_shell, artifact)
|
108
112
|
task.update_title("Updated #{artifact.name.to_s.green}")
|
@@ -1,23 +1,52 @@
|
|
1
1
|
class KuberKit::Core::ContextHelper::ContextVars
|
2
2
|
attr_reader :parent, :parent_name
|
3
3
|
|
4
|
+
BuildArgUndefined = Class.new(KuberKit::Error)
|
5
|
+
|
4
6
|
def initialize(context_vars, parent_name = nil, parent = nil)
|
5
7
|
@context_vars = context_vars
|
6
8
|
@parent_name = parent_name
|
7
9
|
@parent = parent
|
8
10
|
end
|
9
11
|
|
12
|
+
def read(*variable_names)
|
13
|
+
result = self
|
14
|
+
variable_names.each do |var|
|
15
|
+
result = result.get_variable_value(var)
|
16
|
+
end
|
17
|
+
result
|
18
|
+
end
|
19
|
+
|
20
|
+
def variable_defined?(*variable_names)
|
21
|
+
read(*variable_names)
|
22
|
+
return true
|
23
|
+
rescue BuildArgUndefined
|
24
|
+
return false
|
25
|
+
end
|
26
|
+
|
10
27
|
def method_missing(name, *args)
|
11
28
|
if args.size > 0
|
12
29
|
raise ArgumentError.new("context args does not accept any arguments")
|
13
30
|
end
|
14
31
|
|
15
|
-
|
16
|
-
|
32
|
+
read(name)
|
33
|
+
end
|
34
|
+
|
35
|
+
def to_h
|
36
|
+
if @context_vars.is_a?(Hash)
|
37
|
+
return @context_vars
|
38
|
+
else
|
39
|
+
return {value: @context_vars}
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
43
|
+
def get_variable_value(variable_name)
|
44
|
+
value = @context_vars.fetch(variable_name) do
|
45
|
+
raise(BuildArgUndefined, "build arg '#{format_arg(variable_name)}' is not defined, available args: #{@context_vars.inspect}")
|
17
46
|
end
|
18
47
|
|
19
48
|
if value.is_a?(Hash)
|
20
|
-
return self.class.new(value,
|
49
|
+
return self.class.new(value, variable_name, self)
|
21
50
|
end
|
22
51
|
|
23
52
|
value
|
@@ -25,15 +54,15 @@ class KuberKit::Core::ContextHelper::ContextVars
|
|
25
54
|
|
26
55
|
private
|
27
56
|
|
28
|
-
|
29
|
-
|
30
|
-
|
57
|
+
def format_arg(name)
|
58
|
+
string = [@parent_name, name].compact.join(".")
|
59
|
+
parent = @parent
|
31
60
|
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
61
|
+
while parent do
|
62
|
+
string = [parent.parent_name, string].compact.join(".")
|
63
|
+
parent = parent.parent
|
64
|
+
end
|
36
65
|
|
37
|
-
|
38
|
-
|
66
|
+
string
|
67
|
+
end
|
39
68
|
end
|
data/lib/kuber_kit/ui/simple.rb
CHANGED
data/lib/kuber_kit/version.rb
CHANGED
metadata
CHANGED
@@ -1,43 +1,43 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kuber_kit
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Iskander Khaziev
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-08-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
name: contracts
|
14
|
+
name: contracts
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - '='
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
19
|
+
version: 0.16.0
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- -
|
24
|
+
- - '='
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version:
|
26
|
+
version: 0.16.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: dry-auto_inject
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 0.
|
33
|
+
version: 0.8.0
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 0.
|
40
|
+
version: 0.8.0
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: thor
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -114,14 +114,14 @@ dependencies:
|
|
114
114
|
requirements:
|
115
115
|
- - "~>"
|
116
116
|
- !ruby/object:Gem::Version
|
117
|
-
version: '
|
117
|
+
version: '2.2'
|
118
118
|
type: :development
|
119
119
|
prerelease: false
|
120
120
|
version_requirements: !ruby/object:Gem::Requirement
|
121
121
|
requirements:
|
122
122
|
- - "~>"
|
123
123
|
- !ruby/object:Gem::Version
|
124
|
-
version: '
|
124
|
+
version: '2.2'
|
125
125
|
- !ruby/object:Gem::Dependency
|
126
126
|
name: rake
|
127
127
|
requirement: !ruby/object:Gem::Requirement
|
@@ -181,7 +181,6 @@ files:
|
|
181
181
|
- ".travis.yml"
|
182
182
|
- CHANGELOG.md
|
183
183
|
- Gemfile
|
184
|
-
- Gemfile.lock
|
185
184
|
- LICENSE.txt
|
186
185
|
- README.md
|
187
186
|
- Rakefile
|
@@ -362,7 +361,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
362
361
|
- !ruby/object:Gem::Version
|
363
362
|
version: '0'
|
364
363
|
requirements: []
|
365
|
-
rubygems_version: 3.0.
|
364
|
+
rubygems_version: 3.0.3.1
|
366
365
|
signing_key:
|
367
366
|
specification_version: 4
|
368
367
|
summary: Docker Containers Build & Deployment
|
data/Gemfile.lock
DELETED
@@ -1,84 +0,0 @@
|
|
1
|
-
PATH
|
2
|
-
remote: .
|
3
|
-
specs:
|
4
|
-
kuber_kit (0.6.1)
|
5
|
-
cli-ui
|
6
|
-
contracts-lite
|
7
|
-
dry-auto_inject (~> 0.7.0)
|
8
|
-
dry-container (~> 0.7.2)
|
9
|
-
net-ssh
|
10
|
-
thor
|
11
|
-
tty-prompt
|
12
|
-
|
13
|
-
GEM
|
14
|
-
remote: https://rubygems.org/
|
15
|
-
specs:
|
16
|
-
cli-ui (1.5.1)
|
17
|
-
coderay (1.1.3)
|
18
|
-
concurrent-ruby (1.1.9)
|
19
|
-
contracts-lite (0.15.0)
|
20
|
-
diff-lcs (1.4.4)
|
21
|
-
docile (1.3.2)
|
22
|
-
dry-auto_inject (0.7.0)
|
23
|
-
dry-container (>= 0.3.4)
|
24
|
-
dry-configurable (0.12.1)
|
25
|
-
concurrent-ruby (~> 1.0)
|
26
|
-
dry-core (~> 0.5, >= 0.5.0)
|
27
|
-
dry-container (0.7.2)
|
28
|
-
concurrent-ruby (~> 1.0)
|
29
|
-
dry-configurable (~> 0.1, >= 0.1.3)
|
30
|
-
dry-core (0.6.0)
|
31
|
-
concurrent-ruby (~> 1.0)
|
32
|
-
method_source (1.0.0)
|
33
|
-
net-ssh (6.1.0)
|
34
|
-
pastel (0.8.0)
|
35
|
-
tty-color (~> 0.5)
|
36
|
-
pry (0.13.1)
|
37
|
-
coderay (~> 1.1)
|
38
|
-
method_source (~> 1.0)
|
39
|
-
rake (10.5.0)
|
40
|
-
rspec (3.10.0)
|
41
|
-
rspec-core (~> 3.10.0)
|
42
|
-
rspec-expectations (~> 3.10.0)
|
43
|
-
rspec-mocks (~> 3.10.0)
|
44
|
-
rspec-core (3.10.0)
|
45
|
-
rspec-support (~> 3.10.0)
|
46
|
-
rspec-expectations (3.10.0)
|
47
|
-
diff-lcs (>= 1.2.0, < 2.0)
|
48
|
-
rspec-support (~> 3.10.0)
|
49
|
-
rspec-mocks (3.10.0)
|
50
|
-
diff-lcs (>= 1.2.0, < 2.0)
|
51
|
-
rspec-support (~> 3.10.0)
|
52
|
-
rspec-support (3.10.0)
|
53
|
-
simplecov (0.20.0)
|
54
|
-
docile (~> 1.1)
|
55
|
-
simplecov-html (~> 0.11)
|
56
|
-
simplecov_json_formatter (~> 0.1)
|
57
|
-
simplecov-html (0.12.3)
|
58
|
-
simplecov_json_formatter (0.1.2)
|
59
|
-
thor (1.1.0)
|
60
|
-
tty-color (0.6.0)
|
61
|
-
tty-cursor (0.7.1)
|
62
|
-
tty-prompt (0.23.1)
|
63
|
-
pastel (~> 0.8)
|
64
|
-
tty-reader (~> 0.8)
|
65
|
-
tty-reader (0.9.0)
|
66
|
-
tty-cursor (~> 0.7)
|
67
|
-
tty-screen (~> 0.8)
|
68
|
-
wisper (~> 2.0)
|
69
|
-
tty-screen (0.8.1)
|
70
|
-
wisper (2.0.1)
|
71
|
-
|
72
|
-
PLATFORMS
|
73
|
-
ruby
|
74
|
-
|
75
|
-
DEPENDENCIES
|
76
|
-
bundler (~> 1.17)
|
77
|
-
kuber_kit!
|
78
|
-
pry
|
79
|
-
rake (~> 10.0)
|
80
|
-
rspec (~> 3.0)
|
81
|
-
simplecov
|
82
|
-
|
83
|
-
BUNDLED WITH
|
84
|
-
1.17.3
|