kuber_kit 0.9.1 → 0.9.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +2 -2
- data/lib/kuber_kit/configs.rb +3 -3
- data/lib/kuber_kit/image_compiler/action_handler.rb +14 -4
- data/lib/kuber_kit/shell/abstract_shell.rb +0 -4
- data/lib/kuber_kit/shell/commands/bash_commands.rb +6 -16
- data/lib/kuber_kit/shell/local_shell.rb +0 -4
- data/lib/kuber_kit/shell/ssh_shell.rb +0 -4
- data/lib/kuber_kit/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d12070a68a28af618ebe127fd4b5bc6e8091e5eda80d97b02bdc5811250a50a5
|
4
|
+
data.tar.gz: 1596fe61bafd254762585d87cfb72081c4149305d2754c80fb11d032f8deaf70
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5a9ba53c902b8d7b24f84752c2fa71f37e1ed65e017f7a1cb1769590bea8fcbb662e1bd1e1223e44f2edcd3fe9697777054f6beccb777d909a8b704c6f121fc4
|
7
|
+
data.tar.gz: 10885940c62eac245e82522cad006f3709e10d53bbc9b1b9e33fb6917664ed77f353030bd2aeab315722aeb66386e7f465691b5f16d19ded2e14e0672249574b
|
data/CHANGELOG.md
CHANGED
@@ -1,7 +1,7 @@
|
|
1
|
-
**0.9.0-0.9.
|
1
|
+
**0.9.0-0.9.2**
|
2
2
|
- Allow skipping confirmation during deployment
|
3
3
|
- Added `kit sh` command to create a new shell
|
4
|
-
-
|
4
|
+
- Use tmp dir as image builds parent dir for remote compilation
|
5
5
|
|
6
6
|
**0.8.4-0.8.8**
|
7
7
|
- Added initial services support, to deploy before all other servies
|
data/lib/kuber_kit/configs.rb
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
class KuberKit::Configs
|
4
4
|
AVAILABLE_CONFIGS = [
|
5
|
-
:image_dockerfile_name, :image_build_context_dir, :image_tag, :docker_ignore_list, :image_compile_dir,
|
5
|
+
:image_dockerfile_name, :image_build_context_dir, :image_tag, :docker_ignore_list, :image_compile_dir, :remote_image_compile_dir,
|
6
6
|
:kuber_kit_dirname, :kuber_kit_min_version, :images_dirname, :services_dirname, :infra_dirname, :configurations_dirname,
|
7
7
|
:artifact_clone_dir, :service_config_dir, :deployer_strategy, :compile_simultaneous_limit, :deploy_simultaneous_limit,
|
8
8
|
:additional_images_paths, :deprecation_warnings_disabled, :log_file_path, :env_file_compile_dir, :shell_launcher_strategy
|
@@ -40,8 +40,8 @@ class KuberKit::Configs
|
|
40
40
|
set :image_dockerfile_name, "Dockerfile"
|
41
41
|
set :image_build_context_dir, "build_context"
|
42
42
|
set :image_tag, 'latest'
|
43
|
-
|
44
|
-
set :
|
43
|
+
set :image_compile_dir, File.join(absolute_kuber_kit_path, "image_builds")
|
44
|
+
set :remote_image_compile_dir, File.join("tmp", "kuber_kit", "image_builds")
|
45
45
|
set :docker_ignore_list, DOCKER_IGNORE_LIST
|
46
46
|
set :kuber_kit_dirname, "kuber_kit"
|
47
47
|
set :kuber_kit_min_version, KuberKit::VERSION
|
@@ -8,17 +8,27 @@ class KuberKit::ImageCompiler::ActionHandler
|
|
8
8
|
|
9
9
|
Contract KuberKit::Shell::AbstractShell, Symbol, String => Any
|
10
10
|
def call(shell, image_name, build_id)
|
11
|
+
parent_dir = get_image_compile_parent_dir_for_shell(shell)
|
12
|
+
|
11
13
|
image = image_store.get_image(image_name)
|
12
14
|
|
13
|
-
build_dir_cleaner.call(parent_dir:
|
15
|
+
build_dir_cleaner.call(parent_dir: parent_dir)
|
14
16
|
|
15
|
-
compile_dir = generate_compile_dir(build_id: build_id)
|
17
|
+
compile_dir = generate_compile_dir(parent_dir: parent_dir, build_id: build_id)
|
16
18
|
|
17
19
|
compiler.compile(shell, image, compile_dir)
|
18
20
|
end
|
19
21
|
|
20
22
|
private
|
21
|
-
def generate_compile_dir(build_id:)
|
22
|
-
File.join(
|
23
|
+
def generate_compile_dir(parent_dir:, build_id:)
|
24
|
+
File.join(parent_dir, build_id)
|
25
|
+
end
|
26
|
+
|
27
|
+
def get_image_compile_parent_dir_for_shell(shell)
|
28
|
+
if shell.is_a?(KuberKit::Shell::LocalShell)
|
29
|
+
configs.image_compile_dir
|
30
|
+
else
|
31
|
+
configs.remote_image_compile_dir
|
32
|
+
end
|
23
33
|
end
|
24
34
|
end
|
@@ -29,8 +29,4 @@ class KuberKit::Shell::AbstractShell
|
|
29
29
|
def sync(local_path, remote_path, exclude: nil)
|
30
30
|
raise KuberKit::NotImplementedError, "must be implemented"
|
31
31
|
end
|
32
|
-
|
33
|
-
def expand_path(relative_path)
|
34
|
-
raise KuberKit::NotImplementedError, "must be implemented"
|
35
|
-
end
|
36
32
|
end
|
@@ -1,35 +1,25 @@
|
|
1
1
|
class KuberKit::Shell::Commands::BashCommands
|
2
2
|
def rm(shell, path)
|
3
|
-
|
4
|
-
shell.exec!(%Q{rm "#{absolute_path}"})
|
3
|
+
shell.exec!(%Q{rm "#{path}"})
|
5
4
|
end
|
6
5
|
|
7
6
|
def rm_rf(shell, path)
|
8
|
-
|
9
|
-
shell.exec!(%Q{rm -rf "#{absolute_path}"})
|
7
|
+
shell.exec!(%Q{rm -rf "#{path}"})
|
10
8
|
end
|
11
9
|
|
12
10
|
def cp(shell, source_path, dest_path)
|
13
|
-
|
14
|
-
abs_dest_path = shell.expand_path(dest_path)
|
15
|
-
|
16
|
-
shell.exec!(%Q{cp "#{abs_source_path}" "#{abs_dest_path}"})
|
11
|
+
shell.exec!(%Q{cp "#{source_path}" "#{dest_path}"})
|
17
12
|
end
|
18
13
|
|
19
14
|
def cp_r(shell, source_path, dest_path)
|
20
|
-
|
21
|
-
abs_dest_path = shell.expand_path(dest_path)
|
22
|
-
|
23
|
-
shell.exec!(%Q{cp -r "#{abs_source_path}" "#{abs_dest_path}"})
|
15
|
+
shell.exec!(%Q{cp -r "#{source_path}" "#{dest_path}"})
|
24
16
|
end
|
25
17
|
|
26
18
|
def mkdir(shell, path)
|
27
|
-
|
28
|
-
shell.exec!(%Q{mkdir "#{absolute_path}"})
|
19
|
+
shell.exec!(%Q{mkdir "#{path}"})
|
29
20
|
end
|
30
21
|
|
31
22
|
def mkdir_p(shell, path)
|
32
|
-
|
33
|
-
shell.exec!(%Q{mkdir -p "#{absolute_path}"})
|
23
|
+
shell.exec!(%Q{mkdir -p "#{path}"})
|
34
24
|
end
|
35
25
|
end
|
@@ -127,10 +127,6 @@ class KuberKit::Shell::LocalShell < KuberKit::Shell::AbstractShell
|
|
127
127
|
"KIT=#{Process.pid} #{command}"
|
128
128
|
end
|
129
129
|
|
130
|
-
def expand_path(relative_path)
|
131
|
-
File.expand_path(relative_path)
|
132
|
-
end
|
133
|
-
|
134
130
|
private
|
135
131
|
def system_exec(command)
|
136
132
|
exec(command)
|
data/lib/kuber_kit/version.rb
CHANGED