kuber_kit 0.3.0 → 0.3.1

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: 00f2e6ace047f0c5f5e5c4b8595cc0354d89846d2c752e6bd849bb44b1e60fb9
4
- data.tar.gz: c2e9494de5dce8db6221300fc6a3e95e67d979e714edee1b5d72670b38c64c42
3
+ metadata.gz: d3088efcb997e3dda2dbcd85d584265b7a5eec03b20093265842e3396592ab35
4
+ data.tar.gz: a52e92d808c31b2a0f654e8ba2eaa9cf46a0b7352855f7602e63fee7a09a1271
5
5
  SHA512:
6
- metadata.gz: 2503111ae618310fe827d5622f988cd98ae06f4626e39fd1fcbeb8d1b2da8ace07ba3a358a05c048c62a0c463556e4e58c5ba32241a5e2a0ddcdb316b42bc349
7
- data.tar.gz: 0e5eb0798fce0f39a4b777f80e5aeda939a5185e8da1fbd254b6d1e176f27708bd10787757a2c294c1469826c0bec6d20cbc36f73e5912b0a0d0e589d35900b6
6
+ metadata.gz: 5ab6df03558b78d0d146cd6d77224f048564ae8d84c9c6d18d2b9abddb6d6cd8c1e8306549bad16c254fd5632b83c2cfceb690518216251efc4008983aa31f86
7
+ data.tar.gz: 1a2837bfa4334e33fa3c7aee7274516c297e9df0b92adf0fd7f021576c3682af2b48f9336c80b849bf1c5655a88f4d3cf43a42f6669140f5875e99a6710b5a5e
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- kuber_kit (0.3.0)
4
+ kuber_kit (0.3.1)
5
5
  cli-ui
6
6
  contracts-lite
7
7
  dry-auto_inject
data/TODO.md CHANGED
@@ -4,6 +4,5 @@
4
4
  - allow deploying only services enabled for specific configuration
5
5
  - find a way to always deploy some service, e.g. for migrations and env_files
6
6
  - add ability to set container health checks
7
- - implement interactive shell.exec!
8
7
  - template should be able to set default attributes
9
8
  - template should be able to depend on image?
@@ -13,7 +13,12 @@ class KuberKit::ServiceDeployer::Strategies::DockerCompose < KuberKit::ServiceDe
13
13
 
14
14
  deployment_service_name = service.attribute(:deployment_service_name, default: service.name.to_s)
15
15
  deployment_command_name = service.attribute(:deployment_command_name, default: "bash")
16
+ deployment_interactive = service.attribute(:deployment_interactive, default: false)
16
17
 
17
- docker_compose_commands.run(shell, config_path, service: deployment_service_name, command: deployment_command_name)
18
+ docker_compose_commands.run(shell, config_path,
19
+ service: deployment_service_name,
20
+ command: deployment_command_name,
21
+ interactive: deployment_interactive
22
+ )
18
23
  end
19
24
  end
@@ -6,6 +6,10 @@ class KuberKit::Shell::AbstractShell
6
6
  raise KuberKit::NotImplementedError, "must be implemented"
7
7
  end
8
8
 
9
+ def interactive!(command)
10
+ raise KuberKit::NotImplementedError, "must be implemented"
11
+ end
12
+
9
13
  def read(file_path)
10
14
  raise KuberKit::NotImplementedError, "must be implemented"
11
15
  end
@@ -1,5 +1,17 @@
1
1
  class KuberKit::Shell::Commands::DockerComposeCommands
2
- def run(shell, path, service:, command:)
3
- shell.exec!(%Q{docker-compose -f #{path} run #{service} #{command}})
2
+ def run(shell, path, service:, command:, interactive: false)
3
+ command_parts = [
4
+ "docker-compose",
5
+ "-f #{path}",
6
+ "run",
7
+ service,
8
+ command
9
+ ]
10
+
11
+ if interactive
12
+ shell.interactive!(command_parts.join(" "))
13
+ else
14
+ shell.exec!(command_parts.join(" "))
15
+ end
4
16
  end
5
17
  end
@@ -16,9 +16,8 @@ class KuberKit::Shell::Commands::KubectlCommands
16
16
 
17
17
  command_parts += Array(command_list)
18
18
 
19
- # TODO: investigate how to do it with shell.
20
19
  if interactive
21
- system(command_parts.join(" "))
20
+ shell.interactive!(command_parts.join(" "))
22
21
  else
23
22
  shell.exec!(command_parts.join(" "))
24
23
  end
@@ -30,6 +30,16 @@ class KuberKit::Shell::LocalShell < KuberKit::Shell::AbstractShell
30
30
  result
31
31
  end
32
32
 
33
+ def interactive!(command, log_command: true)
34
+ command_number = command_counter.get_number.to_s.rjust(2, "0")
35
+
36
+ if log_command
37
+ logger.info("Interactive: [#{command_number}]: #{command.to_s.cyan}")
38
+ end
39
+
40
+ system(command)
41
+ end
42
+
33
43
  def sync(local_path, remote_path, exclude: nil, delete: true)
34
44
  rsync_commands.rsync(self, local_path, remote_path, exclude: exclude, delete: delete)
35
45
  end
@@ -38,6 +38,10 @@ class KuberKit::Shell::SshShell < KuberKit::Shell::LocalShell
38
38
  raise ShellError.new(e.message)
39
39
  end
40
40
 
41
+ def interactive!(command, log_command: true)
42
+ raise "Currently interactive run is not supported for ssh shell."
43
+ end
44
+
41
45
  def sync(local_path, remote_path, exclude: nil, delete: true)
42
46
  rsync_commands.rsync(
43
47
  local_shell, local_path, remote_path,
@@ -1,3 +1,3 @@
1
1
  module KuberKit
2
- VERSION = "0.3.0"
2
+ VERSION = "0.3.1"
3
3
  end
metadata CHANGED
@@ -1,11 +1,11 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kuber_kit
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Iskander Khaziev
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
  date: 2020-12-10 00:00:00.000000000 Z
@@ -289,7 +289,7 @@ homepage: https://github.com/ArtStation/kuber_kit
289
289
  licenses:
290
290
  - MIT
291
291
  metadata: {}
292
- post_install_message:
292
+ post_install_message:
293
293
  rdoc_options: []
294
294
  require_paths:
295
295
  - lib
@@ -305,7 +305,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
305
305
  version: '0'
306
306
  requirements: []
307
307
  rubygems_version: 3.0.8
308
- signing_key:
308
+ signing_key:
309
309
  specification_version: 4
310
310
  summary: Docker Containers Build & Deployment
311
311
  test_files: []