kuber_kit 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +12 -0
- data/.rspec +3 -0
- data/.ruby-gemset +1 -0
- data/.ruby-version +1 -0
- data/.travis.yml +7 -0
- data/Gemfile +8 -0
- data/Gemfile.lock +67 -0
- data/LICENSE.txt +21 -0
- data/README.md +19 -0
- data/Rakefile +6 -0
- data/TODO.md +2 -0
- data/bin/console +14 -0
- data/bin/kit +8 -0
- data/example/app_data/service.yml +7 -0
- data/example/app_data/test.env +2 -0
- data/example/app_data/test.txt +1 -0
- data/example/configurations/review.rb +4 -0
- data/example/images/app_sources/Dockerfile +6 -0
- data/example/images/app_sources/build_context/source.rb +2 -0
- data/example/images/app_sources/image.rb +4 -0
- data/example/images/ruby/Dockerfile +1 -0
- data/example/images/ruby/image.rb +3 -0
- data/example/images/ruby_app/Dockerfile +11 -0
- data/example/images/ruby_app/build_context/example_file.txt +2 -0
- data/example/images/ruby_app/image.rb +15 -0
- data/example/images/ruby_app2/Dockerfile +8 -0
- data/example/images/ruby_app2/build_context/example_file.txt +2 -0
- data/example/images/ruby_app2/image.rb +4 -0
- data/example/infrastructure/artifacts.rb +13 -0
- data/example/infrastructure/env_files.rb +4 -0
- data/example/infrastructure/registries.rb +4 -0
- data/example/infrastructure/services.rb +3 -0
- data/example/infrastructure/templates.rb +4 -0
- data/kuber_kit.gemspec +35 -0
- data/lib/kuber_kit.rb +205 -0
- data/lib/kuber_kit/actions/configuration_loader.rb +74 -0
- data/lib/kuber_kit/actions/env_file_reader.rb +17 -0
- data/lib/kuber_kit/actions/image_compiler.rb +56 -0
- data/lib/kuber_kit/actions/kubectl_applier.rb +17 -0
- data/lib/kuber_kit/actions/service_applier.rb +39 -0
- data/lib/kuber_kit/actions/service_reader.rb +17 -0
- data/lib/kuber_kit/actions/template_reader.rb +17 -0
- data/lib/kuber_kit/artifacts_sync/abstract_artifact_resolver.rb +5 -0
- data/lib/kuber_kit/artifacts_sync/artifacts_updater.rb +42 -0
- data/lib/kuber_kit/artifacts_sync/git_artifact_resolver.rb +31 -0
- data/lib/kuber_kit/artifacts_sync/null_artifact_resolver.rb +7 -0
- data/lib/kuber_kit/cli.rb +72 -0
- data/lib/kuber_kit/configs.rb +42 -0
- data/lib/kuber_kit/container.rb +207 -0
- data/lib/kuber_kit/core/artifacts/abstract_artifact.rb +13 -0
- data/lib/kuber_kit/core/artifacts/artifact_store.rb +45 -0
- data/lib/kuber_kit/core/artifacts/git.rb +22 -0
- data/lib/kuber_kit/core/artifacts/local.rb +14 -0
- data/lib/kuber_kit/core/configuration.rb +20 -0
- data/lib/kuber_kit/core/configuration_definition.rb +67 -0
- data/lib/kuber_kit/core/configuration_definition_factory.rb +5 -0
- data/lib/kuber_kit/core/configuration_factory.rb +61 -0
- data/lib/kuber_kit/core/configuration_store.rb +72 -0
- data/lib/kuber_kit/core/context_helper/base_helper.rb +28 -0
- data/lib/kuber_kit/core/context_helper/context_helper_factory.rb +23 -0
- data/lib/kuber_kit/core/context_helper/image_helper.rb +2 -0
- data/lib/kuber_kit/core/context_helper/service_helper.rb +19 -0
- data/lib/kuber_kit/core/env_files/abstract_env_file.rb +9 -0
- data/lib/kuber_kit/core/env_files/artifact_file.rb +9 -0
- data/lib/kuber_kit/core/env_files/env_file_store.rb +45 -0
- data/lib/kuber_kit/core/image.rb +39 -0
- data/lib/kuber_kit/core/image_definition.rb +85 -0
- data/lib/kuber_kit/core/image_definition_factory.rb +5 -0
- data/lib/kuber_kit/core/image_factory.rb +40 -0
- data/lib/kuber_kit/core/image_store.rb +60 -0
- data/lib/kuber_kit/core/registries/abstract_registry.rb +25 -0
- data/lib/kuber_kit/core/registries/registry.rb +24 -0
- data/lib/kuber_kit/core/registries/registry_store.rb +49 -0
- data/lib/kuber_kit/core/service.rb +14 -0
- data/lib/kuber_kit/core/service_definition.rb +33 -0
- data/lib/kuber_kit/core/service_definition_factory.rb +5 -0
- data/lib/kuber_kit/core/service_factory.rb +17 -0
- data/lib/kuber_kit/core/service_store.rb +68 -0
- data/lib/kuber_kit/core/templates/abstract_template.rb +9 -0
- data/lib/kuber_kit/core/templates/artifact_file.rb +9 -0
- data/lib/kuber_kit/core/templates/template_store.rb +45 -0
- data/lib/kuber_kit/env_file_reader/abstract_env_file_reader.rb +5 -0
- data/lib/kuber_kit/env_file_reader/artifact_file_reader.rb +86 -0
- data/lib/kuber_kit/env_file_reader/reader.rb +35 -0
- data/lib/kuber_kit/extensions/colored_string.rb +43 -0
- data/lib/kuber_kit/extensions/contracts.rb +4 -0
- data/lib/kuber_kit/extensions/indocker_compat.rb +19 -0
- data/lib/kuber_kit/extensions/inspectable.rb +10 -0
- data/lib/kuber_kit/image_compiler/compiler.rb +21 -0
- data/lib/kuber_kit/image_compiler/image_build_dir_creator.rb +37 -0
- data/lib/kuber_kit/image_compiler/image_builder.rb +26 -0
- data/lib/kuber_kit/image_compiler/image_dependency_resolver.rb +40 -0
- data/lib/kuber_kit/image_compiler/version_tag_builder.rb +5 -0
- data/lib/kuber_kit/preprocessing/dir_preprocessor.rb +19 -0
- data/lib/kuber_kit/preprocessing/file_preprocessor.rb +33 -0
- data/lib/kuber_kit/preprocessing/text_preprocessor.rb +7 -0
- data/lib/kuber_kit/service_deployer/service_list_resolver.rb +56 -0
- data/lib/kuber_kit/service_deployer/service_reader.rb +20 -0
- data/lib/kuber_kit/shell/abstract_shell.rb +20 -0
- data/lib/kuber_kit/shell/bash_commands.rb +25 -0
- data/lib/kuber_kit/shell/command_counter.rb +19 -0
- data/lib/kuber_kit/shell/docker_commands.rb +16 -0
- data/lib/kuber_kit/shell/git_commands.rb +28 -0
- data/lib/kuber_kit/shell/kubectl_commands.rb +12 -0
- data/lib/kuber_kit/shell/local_shell.rb +64 -0
- data/lib/kuber_kit/shell/rsync_commands.rb +20 -0
- data/lib/kuber_kit/template_reader/abstract_template_reader.rb +5 -0
- data/lib/kuber_kit/template_reader/artifact_file_reader.rb +14 -0
- data/lib/kuber_kit/template_reader/reader.rb +35 -0
- data/lib/kuber_kit/tools/file_presence_checker.rb +25 -0
- data/lib/kuber_kit/tools/files_sync.rb +10 -0
- data/lib/kuber_kit/tools/logger_factory.rb +34 -0
- data/lib/kuber_kit/ui.rb +18 -0
- data/lib/kuber_kit/ui/interactive.rb +44 -0
- data/lib/kuber_kit/ui/simple.rb +75 -0
- data/lib/kuber_kit/version.rb +3 -0
- metadata +273 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: a9ac91299a59af0f2eec1d7382f3b55f0946931e1d4f87de909d76631242f441
|
4
|
+
data.tar.gz: d0737d6d217a9c4107fb77536fd36e2c3d59e71adb9dd8c68b6dbc2c12e2eb8f
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: d9feedc39ab9959d1a3e4bd38a5b6703f6d93f16d03bbd4805732166266e64c4dc9798d6e5d173de2e5058f1ccfc8ad86143c793916efd9936768279eedff14f
|
7
|
+
data.tar.gz: a9bf6386c3bac7c75c894f82464af2e9e83dd94e56dec4be9da87fd092c81e9cbff568c4432921ff601c11831127f497651beb835d21edc8379675dffc6c0e1a
|
data/.gitignore
ADDED
data/.rspec
ADDED
data/.ruby-gemset
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
kuber-kit
|
data/.ruby-version
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
2.5.8
|
data/.travis.yml
ADDED
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
@@ -0,0 +1,67 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
kuber_kit (0.1.0)
|
5
|
+
cli-ui
|
6
|
+
contracts-lite
|
7
|
+
dry-auto_inject
|
8
|
+
thor
|
9
|
+
|
10
|
+
GEM
|
11
|
+
remote: https://rubygems.org/
|
12
|
+
specs:
|
13
|
+
cli-ui (1.3.0)
|
14
|
+
coderay (1.1.3)
|
15
|
+
concurrent-ruby (1.1.7)
|
16
|
+
contracts-lite (0.15.0)
|
17
|
+
diff-lcs (1.4.4)
|
18
|
+
docile (1.3.2)
|
19
|
+
dry-auto_inject (0.7.0)
|
20
|
+
dry-container (>= 0.3.4)
|
21
|
+
dry-configurable (0.11.6)
|
22
|
+
concurrent-ruby (~> 1.0)
|
23
|
+
dry-core (~> 0.4, >= 0.4.7)
|
24
|
+
dry-equalizer (~> 0.2)
|
25
|
+
dry-container (0.7.2)
|
26
|
+
concurrent-ruby (~> 1.0)
|
27
|
+
dry-configurable (~> 0.1, >= 0.1.3)
|
28
|
+
dry-core (0.4.9)
|
29
|
+
concurrent-ruby (~> 1.0)
|
30
|
+
dry-equalizer (0.3.0)
|
31
|
+
method_source (1.0.0)
|
32
|
+
pry (0.13.1)
|
33
|
+
coderay (~> 1.1)
|
34
|
+
method_source (~> 1.0)
|
35
|
+
rake (10.5.0)
|
36
|
+
rspec (3.9.0)
|
37
|
+
rspec-core (~> 3.9.0)
|
38
|
+
rspec-expectations (~> 3.9.0)
|
39
|
+
rspec-mocks (~> 3.9.0)
|
40
|
+
rspec-core (3.9.3)
|
41
|
+
rspec-support (~> 3.9.3)
|
42
|
+
rspec-expectations (3.9.3)
|
43
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
44
|
+
rspec-support (~> 3.9.0)
|
45
|
+
rspec-mocks (3.9.1)
|
46
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
47
|
+
rspec-support (~> 3.9.0)
|
48
|
+
rspec-support (3.9.4)
|
49
|
+
simplecov (0.19.0)
|
50
|
+
docile (~> 1.1)
|
51
|
+
simplecov-html (~> 0.11)
|
52
|
+
simplecov-html (0.12.3)
|
53
|
+
thor (1.0.1)
|
54
|
+
|
55
|
+
PLATFORMS
|
56
|
+
ruby
|
57
|
+
|
58
|
+
DEPENDENCIES
|
59
|
+
bundler (~> 1.17)
|
60
|
+
kuber_kit!
|
61
|
+
pry
|
62
|
+
rake (~> 10.0)
|
63
|
+
rspec (~> 3.0)
|
64
|
+
simplecov
|
65
|
+
|
66
|
+
BUNDLED WITH
|
67
|
+
1.17.3
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2020 Iskander Khaziev
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
# Docker Kit
|
2
|
+
|
3
|
+
## Installation
|
4
|
+
|
5
|
+
Add this line to your application's Gemfile:
|
6
|
+
|
7
|
+
```ruby
|
8
|
+
gem 'kuber_kit'
|
9
|
+
```
|
10
|
+
|
11
|
+
## Launch compilation for example images
|
12
|
+
|
13
|
+
```
|
14
|
+
bin/kit compile ruby_app,ruby_app2 --path=./example -C review
|
15
|
+
```
|
16
|
+
|
17
|
+
## License
|
18
|
+
|
19
|
+
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
data/Rakefile
ADDED
data/TODO.md
ADDED
data/bin/console
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require "bundler/setup"
|
4
|
+
require "kuber_kit"
|
5
|
+
|
6
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
7
|
+
# with your gem easier. You can also use a different console, if you like.
|
8
|
+
|
9
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
10
|
+
# require "pry"
|
11
|
+
# Pry.start
|
12
|
+
|
13
|
+
require "irb"
|
14
|
+
IRB.start(__FILE__)
|
data/bin/kit
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
Test Artifact
|
@@ -0,0 +1 @@
|
|
1
|
+
FROM ruby:2.5.8-slim
|
@@ -0,0 +1,15 @@
|
|
1
|
+
KuberKit
|
2
|
+
.define_image(:ruby_app)
|
3
|
+
.registry(:default)
|
4
|
+
.depends_on(:ruby, :app_sources)
|
5
|
+
.before_build do |context_helper, build_dir|
|
6
|
+
# copy file local artifact
|
7
|
+
source_path = context_helper.artifact_path(:kuber_kit_example_data, "test.txt")
|
8
|
+
target_path = File.join(build_dir, "test.txt")
|
9
|
+
context_helper.shell.exec!("cp #{source_path} #{target_path}")
|
10
|
+
|
11
|
+
# copy file local artifact
|
12
|
+
source_path = context_helper.artifact_path(:kuber_kit_repo, "README.md")
|
13
|
+
target_path = File.join(build_dir, "README.md")
|
14
|
+
context_helper.shell.exec!("cp #{source_path} #{target_path}")
|
15
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
data_path = File.expand_path File.join(File.dirname(__FILE__), "..", "app_data")
|
2
|
+
|
3
|
+
KuberKit.add_artifact(
|
4
|
+
KuberKit::Core::Artifacts::Local
|
5
|
+
.new(:kuber_kit_example_data)
|
6
|
+
.setup( data_path )
|
7
|
+
)
|
8
|
+
|
9
|
+
KuberKit.add_artifact(
|
10
|
+
KuberKit::Core::Artifacts::Git
|
11
|
+
.new(:kuber_kit_repo)
|
12
|
+
.setup(remote_url: "git@github.com:ArtStation/kuber_kit.git")
|
13
|
+
)
|
data/kuber_kit.gemspec
ADDED
@@ -0,0 +1,35 @@
|
|
1
|
+
|
2
|
+
lib = File.expand_path("../lib", __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require "kuber_kit/version"
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "kuber_kit"
|
8
|
+
spec.version = KuberKit::VERSION
|
9
|
+
spec.authors = ["Iskander Khaziev"]
|
10
|
+
spec.email = ["gvalmon@gmail.com"]
|
11
|
+
|
12
|
+
spec.summary = %q{Docker Containers Build & Deployment}
|
13
|
+
spec.description = %q{Docker Containers Build & Deployment}
|
14
|
+
spec.homepage = "https://github.com/ArtStation/kuber_kit"
|
15
|
+
spec.license = "MIT"
|
16
|
+
|
17
|
+
# Specify which files should be added to the gem when it is released.
|
18
|
+
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
19
|
+
spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
|
20
|
+
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
21
|
+
end
|
22
|
+
spec.bindir = "bin"
|
23
|
+
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
24
|
+
spec.require_paths = ["lib"]
|
25
|
+
|
26
|
+
spec.add_dependency "contracts-lite"
|
27
|
+
spec.add_dependency "dry-auto_inject"
|
28
|
+
spec.add_dependency "thor"
|
29
|
+
spec.add_dependency "cli-ui"
|
30
|
+
|
31
|
+
spec.add_development_dependency "bundler", "~> 1.17"
|
32
|
+
spec.add_development_dependency "rake", "~> 10.0"
|
33
|
+
spec.add_development_dependency "rspec", "~> 3.0"
|
34
|
+
spec.add_development_dependency "pry"
|
35
|
+
end
|
data/lib/kuber_kit.rb
ADDED
@@ -0,0 +1,205 @@
|
|
1
|
+
require "kuber_kit/version"
|
2
|
+
require 'ostruct'
|
3
|
+
require 'contracts'
|
4
|
+
require 'dry-auto_inject'
|
5
|
+
require 'kuber_kit/extensions/colored_string'
|
6
|
+
require 'kuber_kit/extensions/contracts'
|
7
|
+
|
8
|
+
$LOAD_PATH << File.join(__dir__, 'kuber_kit')
|
9
|
+
|
10
|
+
module KuberKit
|
11
|
+
Error = Class.new(StandardError)
|
12
|
+
NotImplementedError = Class.new(Error)
|
13
|
+
NotFoundError = Class.new(Error)
|
14
|
+
|
15
|
+
module Core
|
16
|
+
autoload :ImageDefinition, 'core/image_definition'
|
17
|
+
autoload :ImageDefinitionFactory, 'core/image_definition_factory'
|
18
|
+
autoload :ImageStore, 'core/image_store'
|
19
|
+
autoload :ImageFactory, 'core/image_factory'
|
20
|
+
autoload :Image, 'core/image'
|
21
|
+
|
22
|
+
autoload :ServiceDefinition, 'core/service_definition'
|
23
|
+
autoload :ServiceDefinitionFactory, 'core/service_definition_factory'
|
24
|
+
autoload :ServiceStore, 'core/service_store'
|
25
|
+
autoload :ServiceFactory, 'core/service_factory'
|
26
|
+
autoload :Service, 'core/service'
|
27
|
+
|
28
|
+
autoload :ConfigurationDefinition, 'core/configuration_definition'
|
29
|
+
autoload :ConfigurationDefinitionFactory, 'core/configuration_definition_factory'
|
30
|
+
autoload :ConfigurationStore, 'core/configuration_store'
|
31
|
+
autoload :ConfigurationFactory, 'core/configuration_factory'
|
32
|
+
autoload :Configuration, 'core/configuration'
|
33
|
+
|
34
|
+
module ContextHelper
|
35
|
+
autoload :BaseHelper, 'core/context_helper/base_helper'
|
36
|
+
autoload :ImageHelper, 'core/context_helper/image_helper'
|
37
|
+
autoload :ServiceHelper, 'core/context_helper/service_helper'
|
38
|
+
autoload :ContextHelperFactory, 'core/context_helper/context_helper_factory'
|
39
|
+
end
|
40
|
+
|
41
|
+
module Registries
|
42
|
+
autoload :AbstractRegistry, 'core/registries/abstract_registry'
|
43
|
+
autoload :RegistryStore, 'core/registries/registry_store'
|
44
|
+
autoload :Registry, 'core/registries/registry'
|
45
|
+
end
|
46
|
+
|
47
|
+
module Artifacts
|
48
|
+
autoload :AbstractArtifact, 'core/artifacts/abstract_artifact'
|
49
|
+
autoload :ArtifactStore, 'core/artifacts/artifact_store'
|
50
|
+
autoload :Git, 'core/artifacts/git'
|
51
|
+
autoload :Local, 'core/artifacts/local'
|
52
|
+
end
|
53
|
+
|
54
|
+
module EnvFiles
|
55
|
+
autoload :EnvFileStore, 'core/env_files/env_file_store'
|
56
|
+
autoload :AbstractEnvFile, 'core/env_files/abstract_env_file'
|
57
|
+
autoload :ArtifactFile, 'core/env_files/artifact_file'
|
58
|
+
end
|
59
|
+
|
60
|
+
module Templates
|
61
|
+
autoload :TemplateStore, 'core/templates/template_store'
|
62
|
+
autoload :AbstractTemplate, 'core/templates/abstract_template'
|
63
|
+
autoload :ArtifactFile, 'core/templates/artifact_file'
|
64
|
+
end
|
65
|
+
end
|
66
|
+
|
67
|
+
module Tools
|
68
|
+
autoload :FilePresenceChecker, 'tools/file_presence_checker'
|
69
|
+
autoload :LoggerFactory, 'tools/logger_factory'
|
70
|
+
autoload :FilesSync, 'tools/files_sync'
|
71
|
+
end
|
72
|
+
|
73
|
+
module Shell
|
74
|
+
autoload :AbstractShell, 'shell/abstract_shell'
|
75
|
+
autoload :LocalShell, 'shell/local_shell'
|
76
|
+
autoload :CommandCounter, 'shell/command_counter'
|
77
|
+
autoload :BashCommands, 'shell/bash_commands'
|
78
|
+
autoload :DockerCommands, 'shell/docker_commands'
|
79
|
+
autoload :GitCommands, 'shell/git_commands'
|
80
|
+
autoload :RsyncCommands, 'shell/rsync_commands'
|
81
|
+
autoload :KubectlCommands, 'shell/kubectl_commands'
|
82
|
+
end
|
83
|
+
|
84
|
+
module ImageCompiler
|
85
|
+
autoload :Compiler, 'image_compiler/compiler'
|
86
|
+
autoload :ImageBuilder, 'image_compiler/image_builder'
|
87
|
+
autoload :ImageBuildDirCreator, 'image_compiler/image_build_dir_creator'
|
88
|
+
autoload :ImageDependencyResolver, 'image_compiler/image_dependency_resolver'
|
89
|
+
autoload :VersionTagBuilder, 'image_compiler/version_tag_builder'
|
90
|
+
end
|
91
|
+
|
92
|
+
module Preprocessing
|
93
|
+
autoload :TextPreprocessor, 'preprocessing/text_preprocessor'
|
94
|
+
autoload :FilePreprocessor, 'preprocessing/file_preprocessor'
|
95
|
+
autoload :DirPreprocessor, 'preprocessing/dir_preprocessor'
|
96
|
+
end
|
97
|
+
|
98
|
+
module ArtifactsSync
|
99
|
+
autoload :AbstractArtifactResolver, 'artifacts_sync/abstract_artifact_resolver'
|
100
|
+
autoload :ArtifactsUpdater, 'artifacts_sync/artifacts_updater'
|
101
|
+
autoload :GitArtifactResolver, 'artifacts_sync/git_artifact_resolver'
|
102
|
+
autoload :NullArtifactResolver, 'artifacts_sync/null_artifact_resolver'
|
103
|
+
end
|
104
|
+
|
105
|
+
module EnvFileReader
|
106
|
+
autoload :Reader, 'env_file_reader/reader'
|
107
|
+
autoload :AbstractEnvFileReader, 'env_file_reader/abstract_env_file_reader'
|
108
|
+
autoload :ArtifactFileReader, 'env_file_reader/artifact_file_reader'
|
109
|
+
end
|
110
|
+
|
111
|
+
module TemplateReader
|
112
|
+
autoload :Reader, 'template_reader/reader'
|
113
|
+
autoload :AbstractTemplateReader, 'template_reader/abstract_template_reader'
|
114
|
+
autoload :ArtifactFileReader, 'template_reader/artifact_file_reader'
|
115
|
+
end
|
116
|
+
|
117
|
+
module ServiceDeployer
|
118
|
+
autoload :ServiceReader, 'service_deployer/service_reader'
|
119
|
+
autoload :ServiceApplier, 'service_deployer/service_applier'
|
120
|
+
autoload :ServiceListResolver, 'service_deployer/service_list_resolver'
|
121
|
+
end
|
122
|
+
|
123
|
+
module Actions
|
124
|
+
autoload :ImageCompiler, 'actions/image_compiler'
|
125
|
+
autoload :EnvFileReader, 'actions/env_file_reader'
|
126
|
+
autoload :TemplateReader, 'actions/template_reader'
|
127
|
+
autoload :ServiceReader, 'actions/service_reader'
|
128
|
+
autoload :ServiceApplier, 'actions/service_applier'
|
129
|
+
autoload :ConfigurationLoader, 'actions/configuration_loader'
|
130
|
+
autoload :KubectlApplier, 'actions/kubectl_applier'
|
131
|
+
end
|
132
|
+
|
133
|
+
module Extensions
|
134
|
+
autoload :Inspectable, 'extensions/inspectable'
|
135
|
+
end
|
136
|
+
|
137
|
+
module UI
|
138
|
+
autoload :Interactive, 'ui/interactive'
|
139
|
+
autoload :Simple, 'ui/simple'
|
140
|
+
end
|
141
|
+
|
142
|
+
autoload :Configs, 'configs'
|
143
|
+
autoload :CLI, 'cli'
|
144
|
+
autoload :Container, 'container'
|
145
|
+
|
146
|
+
Import = Dry::AutoInject(Container)
|
147
|
+
|
148
|
+
class << self
|
149
|
+
def define_image(image_name)
|
150
|
+
image_path = caller[0].split(':').first
|
151
|
+
|
152
|
+
Container["core.image_store"].define(image_name, image_path.split('image.rb').first)
|
153
|
+
end
|
154
|
+
|
155
|
+
def define_service(service_name)
|
156
|
+
Container["core.service_store"].define(service_name)
|
157
|
+
end
|
158
|
+
|
159
|
+
def define_configuration(configuration_name)
|
160
|
+
Container["core.configuration_store"].define(configuration_name)
|
161
|
+
end
|
162
|
+
|
163
|
+
def set_configuration_name(configuration_name)
|
164
|
+
@configuration_name = configuration_name.to_sym
|
165
|
+
@current_configuration = nil
|
166
|
+
end
|
167
|
+
|
168
|
+
def set_debug_mode(value)
|
169
|
+
@debug_mode = value
|
170
|
+
end
|
171
|
+
|
172
|
+
def debug_mode?
|
173
|
+
!!@debug_mode
|
174
|
+
end
|
175
|
+
|
176
|
+
def current_configuration
|
177
|
+
if @configuration_name.nil?
|
178
|
+
raise "Please set configuration name before calling current_configuration"
|
179
|
+
end
|
180
|
+
@current_configuration ||= Container['core.configuration_store'].get_configuration(@configuration_name)
|
181
|
+
end
|
182
|
+
|
183
|
+
def add_registry(registry)
|
184
|
+
Container["core.registry_store"].add(registry)
|
185
|
+
end
|
186
|
+
|
187
|
+
def add_artifact(artifact)
|
188
|
+
Container["core.artifact_store"].add(artifact)
|
189
|
+
end
|
190
|
+
|
191
|
+
def add_env_file(env_file)
|
192
|
+
Container["core.env_file_store"].add(env_file)
|
193
|
+
end
|
194
|
+
|
195
|
+
def add_template(template)
|
196
|
+
Container["core.template_store"].add(template)
|
197
|
+
end
|
198
|
+
|
199
|
+
def build_helper(&proc)
|
200
|
+
KuberKit::Core::ContextHelper::BaseHelper.class_exec(&proc)
|
201
|
+
end
|
202
|
+
end
|
203
|
+
end
|
204
|
+
|
205
|
+
require 'kuber_kit/extensions/indocker_compat'
|