kuber_kit 0.9.1 → 0.9.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 74747b7166c91e6a78919e9888e8a643a0b199d4e3457015d902e7d12be0df1f
4
- data.tar.gz: e292c750666b58996116cd1eb01a43f9472120346235eeec2cd3d7434770b381
3
+ metadata.gz: d12070a68a28af618ebe127fd4b5bc6e8091e5eda80d97b02bdc5811250a50a5
4
+ data.tar.gz: 1596fe61bafd254762585d87cfb72081c4149305d2754c80fb11d032f8deaf70
5
5
  SHA512:
6
- metadata.gz: c06ee817240523fa6faec061d223337ed08d683a0ba15c671f4d65f1cdb1e3e8ce088ffb130f48d2c37a030f9200fde54b69ea6f6a542621266cb59ad6b7aa80
7
- data.tar.gz: 989df85f77d4c8676def49566c8277172b8498f19798ce273704e3cd818176bd8fce4efe5bf208db88441d2d1ab38257c7d45ad6cc5895a95b9de10056eb9ff8
6
+ metadata.gz: 5a9ba53c902b8d7b24f84752c2fa71f37e1ed65e017f7a1cb1769590bea8fcbb662e1bd1e1223e44f2edcd3fe9697777054f6beccb777d909a8b704c6f121fc4
7
+ data.tar.gz: 10885940c62eac245e82522cad006f3709e10d53bbc9b1b9e33fb6917664ed77f353030bd2aeab315722aeb66386e7f465691b5f16d19ded2e14e0672249574b
data/CHANGELOG.md CHANGED
@@ -1,7 +1,7 @@
1
- **0.9.0-0.9.1**
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
- - Do not expand image compile directory path in default config
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
@@ -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
- # do not use absolute path for compile dir, compilation could be done on remote server
44
- set :image_compile_dir, File.join(home_kuber_kit_path, "image_builds")
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: configs.image_compile_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(configs.image_compile_dir, build_id)
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
- absolute_path = shell.expand_path(path)
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
- absolute_path = shell.expand_path(path)
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
- abs_source_path = shell.expand_path(source_path)
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
- abs_source_path = shell.expand_path(source_path)
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
- absolute_path = shell.expand_path(path)
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
- absolute_path = shell.expand_path(path)
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)
@@ -71,10 +71,6 @@ class KuberKit::Shell::SshShell < KuberKit::Shell::LocalShell
71
71
  true
72
72
  end
73
73
 
74
- def expand_path(relative_path)
75
- exec!("readlink -f #{relative_path}")
76
- end
77
-
78
74
  private
79
75
  def ssh_session
80
76
  unless connected?
@@ -1,3 +1,3 @@
1
1
  module KuberKit
2
- VERSION = "0.9.1"
2
+ VERSION = "0.9.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kuber_kit
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.1
4
+ version: 0.9.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Iskander Khaziev