kuber_kit 0.1.4 → 0.1.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +4 -2
- data/README.md +16 -3
- data/TODO.md +4 -4
- data/example/app_data/env_file.yml +10 -0
- data/example/configurations/review.rb +2 -1
- data/example/images/app_sources/Dockerfile +1 -1
- data/example/images/ruby_app/image.rb +4 -4
- data/example/infrastructure/build_servers.rb +8 -0
- data/example/infrastructure/templates.rb +5 -0
- data/example/services/env_file.rb +6 -0
- data/kuber_kit.gemspec +1 -0
- data/lib/kuber_kit.rb +50 -23
- data/lib/kuber_kit/actions/configuration_loader.rb +5 -0
- data/lib/kuber_kit/actions/env_file_reader.rb +8 -5
- data/lib/kuber_kit/actions/image_compiler.rb +18 -22
- data/lib/kuber_kit/actions/kubectl_applier.rb +6 -1
- data/lib/kuber_kit/actions/service_deployer.rb +13 -3
- data/lib/kuber_kit/actions/service_reader.rb +9 -6
- data/lib/kuber_kit/actions/template_reader.rb +5 -0
- data/lib/kuber_kit/cli.rb +12 -6
- data/lib/kuber_kit/configs.rb +24 -22
- data/lib/kuber_kit/container.rb +39 -19
- data/lib/kuber_kit/core/artifacts/artifact_store.rb +12 -23
- data/lib/kuber_kit/core/build_servers/abstract_build_server.rb +21 -0
- data/lib/kuber_kit/core/build_servers/build_server.rb +24 -0
- data/lib/kuber_kit/core/build_servers/build_server_store.rb +18 -0
- data/lib/kuber_kit/core/configuration.rb +14 -4
- data/lib/kuber_kit/core/configuration_definition.rb +22 -1
- data/lib/kuber_kit/core/configuration_factory.rb +11 -1
- data/lib/kuber_kit/core/configuration_store.rb +14 -24
- data/lib/kuber_kit/core/context_helper/base_helper.rb +12 -7
- data/lib/kuber_kit/core/context_helper/context_helper_factory.rb +11 -8
- data/lib/kuber_kit/core/context_helper/service_helper.rb +9 -4
- data/lib/kuber_kit/core/env_files/env_file_store.rb +8 -23
- data/lib/kuber_kit/core/image_store.rb +8 -18
- data/lib/kuber_kit/core/registries/registry_store.rb +8 -23
- data/lib/kuber_kit/core/service.rb +19 -3
- data/lib/kuber_kit/core/service_definition.rb +7 -0
- data/lib/kuber_kit/core/service_factory.rb +5 -1
- data/lib/kuber_kit/core/service_store.rb +13 -23
- data/lib/kuber_kit/core/store.rb +48 -0
- data/lib/kuber_kit/core/templates/template_store.rb +12 -23
- data/lib/kuber_kit/env_file_reader/action_handler.rb +12 -0
- data/lib/kuber_kit/env_file_reader/reader.rb +4 -4
- data/lib/kuber_kit/env_file_reader/{abstract_env_file_reader.rb → strategies/abstract.rb} +1 -1
- data/lib/kuber_kit/env_file_reader/{artifact_file_reader.rb → strategies/artifact_file.rb} +1 -1
- data/lib/kuber_kit/image_compiler/action_handler.rb +21 -0
- data/lib/kuber_kit/image_compiler/build_server_pool.rb +30 -0
- data/lib/kuber_kit/image_compiler/build_server_pool_factory.rb +13 -0
- data/lib/kuber_kit/image_compiler/compiler.rb +2 -5
- data/lib/kuber_kit/image_compiler/image_build_dir_creator.rb +13 -7
- data/lib/kuber_kit/image_compiler/image_dependency_resolver.rb +25 -5
- data/lib/kuber_kit/preprocessing/file_preprocessor.rb +5 -4
- data/lib/kuber_kit/preprocessing/text_preprocessor.rb +1 -1
- data/lib/kuber_kit/service_deployer/action_handler.rb +16 -0
- data/lib/kuber_kit/service_deployer/deployer.rb +28 -6
- data/lib/kuber_kit/service_deployer/strategies/abstract.rb +1 -1
- data/lib/kuber_kit/service_deployer/strategies/kubernetes.rb +9 -4
- data/lib/kuber_kit/service_deployer/strategy_detector.rb +6 -0
- data/lib/kuber_kit/service_reader/action_handler.rb +13 -0
- data/lib/kuber_kit/{service_deployer/service_reader.rb → service_reader/reader.rb} +1 -1
- data/lib/kuber_kit/shell/abstract_shell.rb +4 -0
- data/lib/kuber_kit/shell/{bash_commands.rb → commands/bash_commands.rb} +1 -1
- data/lib/kuber_kit/shell/{docker_commands.rb → commands/docker_commands.rb} +1 -1
- data/lib/kuber_kit/shell/{git_commands.rb → commands/git_commands.rb} +1 -1
- data/lib/kuber_kit/shell/{kubectl_commands.rb → commands/kubectl_commands.rb} +1 -1
- data/lib/kuber_kit/shell/{rsync_commands.rb → commands/rsync_commands.rb} +9 -3
- data/lib/kuber_kit/shell/local_shell.rb +24 -5
- data/lib/kuber_kit/shell/ssh_session.rb +60 -0
- data/lib/kuber_kit/shell/ssh_shell.rb +77 -0
- data/lib/kuber_kit/tools/file_presence_checker.rb +6 -2
- data/lib/kuber_kit/version.rb +1 -1
- metadata +40 -13
- data/lib/kuber_kit/preprocessing/dir_preprocessor.rb +0 -19
- data/lib/kuber_kit/service_deployer/service_restarter.rb +0 -37
- data/lib/kuber_kit/tools/files_sync.rb +0 -10
@@ -1,19 +0,0 @@
|
|
1
|
-
class KuberKit::Preprocessing::DirPreprocessor
|
2
|
-
include KuberKit::Import[
|
3
|
-
"preprocessing.file_preprocessor",
|
4
|
-
"shell.bash_commands"
|
5
|
-
]
|
6
|
-
|
7
|
-
def compile(shell, source_dir, destination_dir, context_helper: nil)
|
8
|
-
shell.recursive_list_files(source_dir).each do |source_file_path|
|
9
|
-
relative_path = source_file_path.sub(source_dir, '')
|
10
|
-
destination_file_path = File.join(destination_dir, relative_path)
|
11
|
-
|
12
|
-
file_preprocessor.compile(
|
13
|
-
shell, source_file_path,
|
14
|
-
destination_path: destination_file_path,
|
15
|
-
context_helper: context_helper
|
16
|
-
)
|
17
|
-
end
|
18
|
-
end
|
19
|
-
end
|
@@ -1,37 +0,0 @@
|
|
1
|
-
class KuberKit::ServiceDeployer::ServiceRestarter
|
2
|
-
StrategyNotFoundError = Class.new(KuberKit::NotFoundError)
|
3
|
-
|
4
|
-
include KuberKit::Import[
|
5
|
-
"core.service_store",
|
6
|
-
"service_deployer.strategies.kubernetes"
|
7
|
-
]
|
8
|
-
|
9
|
-
def register_strategy(strategy_name, strategy)
|
10
|
-
@@strategies ||= {}
|
11
|
-
|
12
|
-
if !strategy.is_a?(KuberKit::ServiceDeployer::Strategies::Abstract)
|
13
|
-
raise ArgumentError.new("should be an instance of KuberKit::ServiceDeployer::Strategies::Abstract, got: #{strategy.inspect}")
|
14
|
-
end
|
15
|
-
|
16
|
-
@@strategies[strategy_name] = strategy
|
17
|
-
end
|
18
|
-
|
19
|
-
Contract KuberKit::Shell::AbstractShell, KuberKit::Core::Service, Symbol => Any
|
20
|
-
def restart(shell, service, strategy_name)
|
21
|
-
add_default_strategies
|
22
|
-
|
23
|
-
restarter = @@strategies[strategy_name]
|
24
|
-
|
25
|
-
raise StrategyNotFoundError, "Can't find strategy with name #{strategy_name}" if restarter.nil?
|
26
|
-
|
27
|
-
restarter.restart(shell, service)
|
28
|
-
end
|
29
|
-
|
30
|
-
def add_default_strategies
|
31
|
-
register_strategy(:kubernetes, kubernetes)
|
32
|
-
end
|
33
|
-
|
34
|
-
def reset!
|
35
|
-
@@strategies = {}
|
36
|
-
end
|
37
|
-
end
|