stable-cli-rails 0.6.6 → 0.6.7
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 +14 -9
- 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: d85bcf8eb4e71a8dc2c0bdb7e77fd053f844c81160f5c8cdc4d6fa42194b1275
|
|
4
|
+
data.tar.gz: 0465bfad22e484c444f3c0564e54e135d7f2c83e93996af0085e9f3aa8cf1f6a
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 7dfdd1728588725ffdc0fda92cb367fb53323f5e6683c2c78c2b10a9ce06fef8ca5df494a11868c260f3be12d88021f0d922e88add43b97fd91a32e56432c342
|
|
7
|
+
data.tar.gz: e8e9f9cf95140ec1090130c059ebfca7087a2377136bc306a304918d0e35b1e25a3dd4c448cd99cce5a8e0eec22766298586d16ce463f2b28c6de678f1ed8d92
|
data/lib/stable/cli.rb
CHANGED
|
@@ -75,9 +75,18 @@ module Stable
|
|
|
75
75
|
puts "Starting Rails server for #{name} on port #{port}..."
|
|
76
76
|
log_file = File.join(app_path, 'log', 'stable.log')
|
|
77
77
|
FileUtils.mkdir_p(File.dirname(log_file))
|
|
78
|
-
|
|
78
|
+
|
|
79
|
+
pid = spawn(
|
|
80
|
+
'bash',
|
|
81
|
+
'-lc',
|
|
82
|
+
"cd #{app_path} && rvm #{ruby}@#{name} do bundle exec rails s -p #{port} -b 127.0.0.1",
|
|
83
|
+
out: log_file,
|
|
84
|
+
err: log_file
|
|
85
|
+
)
|
|
79
86
|
Process.detach(pid)
|
|
80
87
|
|
|
88
|
+
sleep 1.5
|
|
89
|
+
|
|
81
90
|
wait_for_port(port)
|
|
82
91
|
puts "✔ #{name} running at https://#{domain}"
|
|
83
92
|
end
|
|
@@ -172,21 +181,17 @@ module Stable
|
|
|
172
181
|
end
|
|
173
182
|
end
|
|
174
183
|
|
|
175
|
-
cmd = <<~CMD
|
|
176
|
-
cd #{app[:path]} &&
|
|
177
|
-
#{ruby_exec} bundle exec rails s -p #{port}
|
|
178
|
-
CMD
|
|
179
|
-
|
|
180
184
|
pid = spawn(
|
|
181
185
|
'bash',
|
|
182
186
|
'-lc',
|
|
183
|
-
|
|
187
|
+
"cd #{app[:path]} && rvm #{ruby}@#{name} do bundle exec rails s -p #{port} -b 127.0.0.1",
|
|
184
188
|
out: log_file,
|
|
185
189
|
err: log_file
|
|
186
190
|
)
|
|
187
|
-
|
|
188
191
|
Process.detach(pid)
|
|
189
192
|
|
|
193
|
+
sleep 1.5
|
|
194
|
+
|
|
190
195
|
generate_cert(app[:domain])
|
|
191
196
|
update_caddyfile(app[:domain], port)
|
|
192
197
|
wait_for_port(port)
|
|
@@ -476,7 +481,7 @@ module Stable
|
|
|
476
481
|
end
|
|
477
482
|
end
|
|
478
483
|
|
|
479
|
-
def wait_for_port(port, timeout:
|
|
484
|
+
def wait_for_port(port, timeout: 30)
|
|
480
485
|
require 'socket'
|
|
481
486
|
start_time = Time.now
|
|
482
487
|
loop do
|