stable-cli-rails 0.6.0 → 0.6.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 +4 -4
- data/lib/stable/cli.rb +8 -7
- 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: df1dff802e1adf63c1f0dd70227d09a33a32fb2678a06867a260208344cce9fe
|
|
4
|
+
data.tar.gz: 1da4b5ca121d014c248cf3bad353cfc2176a03c85c8a5fb0ba23a15d437a7c65
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 96df4f8ef2eda56be3d7749436315bb1108969adc30c94daaf5d1c9fded4f83d027347dd228b587d7a821f63e27fdc36be85322523491bf5507af270e441253f
|
|
7
|
+
data.tar.gz: 701bde4cfbfac53a7646cc3c480540608074918e8df00642961f683a81c29a380a264fe77015504fb92d4f53bd7b624f4c49fca0cba19bb84ac64af6c9c4e7e7
|
data/lib/stable/cli.rb
CHANGED
|
@@ -78,7 +78,7 @@ module Stable
|
|
|
78
78
|
pid = spawn("bash -lc 'rvm #{ruby}@#{name} do cd #{app_path} && bundle exec rails s -p #{port} >> #{log_file} 2>&1'")
|
|
79
79
|
Process.detach(pid)
|
|
80
80
|
|
|
81
|
-
wait_for_port(port)
|
|
81
|
+
wait_for_port(port, timeout: 45)
|
|
82
82
|
puts "✔ #{name} running at https://#{domain}"
|
|
83
83
|
end
|
|
84
84
|
|
|
@@ -189,7 +189,7 @@ module Stable
|
|
|
189
189
|
|
|
190
190
|
generate_cert(app[:domain])
|
|
191
191
|
update_caddyfile(app[:domain], port)
|
|
192
|
-
wait_for_port(port)
|
|
192
|
+
wait_for_port(port, timeout: 45)
|
|
193
193
|
caddy_reload
|
|
194
194
|
|
|
195
195
|
puts "#{name} started on https://#{app[:domain]}"
|
|
@@ -476,16 +476,17 @@ module Stable
|
|
|
476
476
|
end
|
|
477
477
|
end
|
|
478
478
|
|
|
479
|
-
def wait_for_port(port, timeout:
|
|
479
|
+
def wait_for_port(port, timeout: 45)
|
|
480
480
|
require 'socket'
|
|
481
|
-
|
|
481
|
+
start = Time.now
|
|
482
|
+
|
|
482
483
|
loop do
|
|
483
484
|
TCPSocket.new('127.0.0.1', port).close
|
|
484
|
-
|
|
485
|
+
return true
|
|
485
486
|
rescue Errno::ECONNREFUSED
|
|
486
|
-
raise "
|
|
487
|
+
raise "Rails failed to start on port #{port} within #{timeout}s" if Time.now - start > timeout
|
|
487
488
|
|
|
488
|
-
sleep 0.
|
|
489
|
+
sleep 0.5
|
|
489
490
|
end
|
|
490
491
|
end
|
|
491
492
|
|