kamal 2.2.1 → 2.2.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: 69b742751668ecf7877e0afc8e71a111e3faad501fe5ea01ff773793bf599df7
4
- data.tar.gz: f5e3738aac9cdbc2f9e493613c0c975ef7c7939ba06f9982a1508f5440c02213
3
+ metadata.gz: 7da17dcbc307380fd036004d67e3007ea6824a4b634f161c2882776b5c2020df
4
+ data.tar.gz: c394f629044adecac7c2bc65a8ea6615269a010d68be8051c4fd4c579e5be686
5
5
  SHA512:
6
- metadata.gz: 6466a0ffb55dacfe8e2f411341ecdd6a71f4f00dc0f995789d8225ab39d0c9cbd9f5b1e88016e5ab06e88cea4bba6fac48d847d8ee84f37cf2f251d021bba1b1
7
- data.tar.gz: c4efb73c259cd4ae0d5025c6eccecb3aaa622b9ce93d5cf11d0794f3673a36b8decfb61f1092449e2a293562ec3fb1df45eca7e5158179373a48734b99c4a46c
6
+ metadata.gz: 41028ff1893c92dfea1d1de5f5289e60fd719f28445f7f827b513482463e364e3640a88003ef68b24b4fcb4f502f88dbb3daf9c4e04d956fc8a03e09d4f64d90
7
+ data.tar.gz: b6db1eb9d4acbd57ce4fcce79798a2f1ad47cd043e2624c03ee940a86fc32bf49bf0446c70142e98e7d87e06cc5c6ee6dd89448533b5c2577fd2d6ee57faaa87
@@ -21,7 +21,7 @@ class Kamal::Cli::Proxy < Kamal::Cli::Base
21
21
  end
22
22
  end
23
23
 
24
- desc "boot_config <set|get|reset>", "Mange kamal-proxy boot configuration"
24
+ desc "boot_config <set|get|reset>", "Manage kamal-proxy boot configuration"
25
25
  option :publish, type: :boolean, default: true, desc: "Publish the proxy ports on the host"
26
26
  option :http_port, type: :numeric, default: Kamal::Configuration::PROXY_HTTP_PORT, desc: "HTTP port to publish on the host"
27
27
  option :https_port, type: :numeric, default: Kamal::Configuration::PROXY_HTTPS_PORT, desc: "HTTPS port to publish on the host"
@@ -11,14 +11,7 @@ module Kamal::Commands
11
11
  end
12
12
 
13
13
  def run_over_ssh(*command, host:)
14
- "ssh".tap do |cmd|
15
- if config.ssh.proxy && config.ssh.proxy.is_a?(Net::SSH::Proxy::Jump)
16
- cmd << " -J #{config.ssh.proxy.jump_proxies}"
17
- elsif config.ssh.proxy && config.ssh.proxy.is_a?(Net::SSH::Proxy::Command)
18
- cmd << " -o ProxyCommand='#{config.ssh.proxy.command_line_template}'"
19
- end
20
- cmd << " -t #{config.ssh.user}@#{host} -p #{config.ssh.port} '#{command.join(" ").gsub("'", "'\\\\''")}'"
21
- end
14
+ "ssh#{ssh_proxy_args} -t #{config.ssh.user}@#{host} -p #{config.ssh.port} '#{command.join(" ").gsub("'", "'\\\\''")}'"
22
15
  end
23
16
 
24
17
  def container_id_for(container_name:, only_running: false)
@@ -92,5 +85,14 @@ module Kamal::Commands
92
85
  def tags(**details)
93
86
  Kamal::Tags.from_config(config, **details)
94
87
  end
88
+
89
+ def ssh_proxy_args
90
+ case config.ssh.proxy
91
+ when Net::SSH::Proxy::Jump
92
+ " -J #{config.ssh.proxy.jump_proxies}"
93
+ when Net::SSH::Proxy::Command
94
+ " -o ProxyCommand='#{config.ssh.proxy.command_line_template}'"
95
+ end
96
+ end
95
97
  end
96
98
  end
@@ -1,29 +1,31 @@
1
1
  module Kamal::Commands::Builder::Clone
2
- extend ActiveSupport::Concern
3
-
4
- included do
5
- delegate :clone_directory, :build_directory, to: :"config.builder"
6
- end
7
-
8
2
  def clone
9
- git :clone, Kamal::Git.root, "--recurse-submodules", path: clone_directory
3
+ git :clone, escaped_root, "--recurse-submodules", path: config.builder.clone_directory.shellescape
10
4
  end
11
5
 
12
6
  def clone_reset_steps
13
7
  [
14
- git(:remote, "set-url", :origin, Kamal::Git.root, path: build_directory),
15
- git(:fetch, :origin, path: build_directory),
16
- git(:reset, "--hard", Kamal::Git.revision, path: build_directory),
17
- git(:clean, "-fdx", path: build_directory),
18
- git(:submodule, :update, "--init", path: build_directory)
8
+ git(:remote, "set-url", :origin, escaped_root, path: escaped_build_directory),
9
+ git(:fetch, :origin, path: escaped_build_directory),
10
+ git(:reset, "--hard", Kamal::Git.revision, path: escaped_build_directory),
11
+ git(:clean, "-fdx", path: escaped_build_directory),
12
+ git(:submodule, :update, "--init", path: escaped_build_directory)
19
13
  ]
20
14
  end
21
15
 
22
16
  def clone_status
23
- git :status, "--porcelain", path: build_directory
17
+ git :status, "--porcelain", path: escaped_build_directory
24
18
  end
25
19
 
26
20
  def clone_revision
27
- git :"rev-parse", :HEAD, path: build_directory
21
+ git :"rev-parse", :HEAD, path: escaped_build_directory
22
+ end
23
+
24
+ def escaped_root
25
+ Kamal::Git.root.shellescape
26
+ end
27
+
28
+ def escaped_build_directory
29
+ config.builder.build_directory.shellescape
28
30
  end
29
31
  end
data/lib/kamal/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Kamal
2
- VERSION = "2.2.1"
2
+ VERSION = "2.2.2"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kamal
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.1
4
+ version: 2.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Heinemeier Hansson
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-10-09 00:00:00.000000000 Z
11
+ date: 2024-10-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport