kamal 2.8.0 → 2.8.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: 80ba6d51041312c99d659a1bfaac13bfa0ed7d1e758bde65e5475c0e51d88238
4
- data.tar.gz: f0cc94a905da2cfb5dcf4f5d9ead2194df1b0ed46fd3b8671a59bfc333b10fbf
3
+ metadata.gz: fd8b2329effde7405d2a1b8d60f394d1da81faaf5e8bcd6980c83f8bb590f988
4
+ data.tar.gz: 5543d21fbe88acf86a24fcf1f44dff30e0aaf410b3ead0293b0f005b15fa2cbb
5
5
  SHA512:
6
- metadata.gz: e33ddb40f46e587364d9121bbd2f2d829beddeb956f4bf1d8399e5ac835285180914f51e1365bee96ec4b82a02c0e88df8ff513a68bf95e44a8dc7e0ce081509
7
- data.tar.gz: 8a0b1a90bbacd96d072cbbe5cec3371e5f7fe6d213cfa5dac3203f6d4ef02fadbddd1e3458909f3051adcd9218d69d6edb5b193f86fca6fac28b49b00bd2dd91
6
+ metadata.gz: bdae637114b1ad0630d5b1bbc0e76be5ebb3817d370d1f3f5a4222024f13fa3546a24806ad812e9d6d14735c2be23ed6956702723e75cc27c5ec34ebe87d72f9
7
+ data.tar.gz: 8db206acbeb707f3a0d3267720b9d248cb2566517d340a61072777e0fdbbf237701d42e203d2d96b21fb7c04596896d6039c4ba9d59eb1515d47de0f85148248
@@ -1,3 +1,5 @@
1
+ require "concurrent/atomic/count_down_latch"
2
+
1
3
  class Kamal::Cli::PortForwarding
2
4
  attr_reader :hosts, :port
3
5
 
@@ -23,13 +25,22 @@ class Kamal::Cli::PortForwarding
23
25
  end
24
26
 
25
27
  def forward_ports
28
+ ready = Concurrent::CountDownLatch.new(hosts.size)
29
+
26
30
  @threads = hosts.map do |host|
27
31
  Thread.new do
28
32
  Net::SSH.start(host, KAMAL.config.ssh.user, **{ proxy: KAMAL.config.ssh.proxy }.compact) do |ssh|
29
- ssh.forward.remote(port, "localhost", port, "localhost")
33
+ ssh.forward.remote(port, "localhost", port, "127.0.0.1") do |remote_port, bind_address|
34
+ if remote_port == :error
35
+ raise "Failed to establish port forward on #{host}"
36
+ else
37
+ ready.count_down
38
+ end
39
+ end
40
+
30
41
  ssh.loop(0.1) do
31
42
  if @done
32
- ssh.forward.cancel_remote(port, "localhost")
43
+ ssh.forward.cancel_remote(port, "127.0.0.1")
33
44
  break
34
45
  else
35
46
  true
@@ -38,5 +49,7 @@ class Kamal::Cli::PortForwarding
38
49
  end
39
50
  end
40
51
  end
52
+
53
+ raise "Timed out waiting for port forwarding to be established" unless ready.wait(10)
41
54
  end
42
55
  end
@@ -140,3 +140,11 @@ class SSHKit::Runner::Parallel
140
140
 
141
141
  prepend CompleteAll
142
142
  end
143
+
144
+ # Avoid net-ssh debug, until https://github.com/net-ssh/net-ssh/pull/953 is merged
145
+ module NetSshForwardingNoPuts
146
+ def puts(*)
147
+ end
148
+ end
149
+
150
+ Net::SSH::Service::Forward.prepend NetSshForwardingNoPuts
data/lib/kamal/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Kamal
2
- VERSION = "2.8.0"
2
+ VERSION = "2.8.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kamal
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.8.0
4
+ version: 2.8.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Heinemeier Hansson