smartcloud 0.1.0.rc2 → 0.1.0.rc3
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/smartcloud/grids/buildpacker.rb +22 -9
- data/lib/smartcloud/grids/runner.rb +9 -4
- 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: 1bc0f44f2fa9ea9d6145f30db4d8c96a143e839801e8f821df13fbaa533cb2b3
|
4
|
+
data.tar.gz: 51bd95740b92513e81ab404007a7b5544c98285b956ad08f445614e4ab938b12
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cce759ba90e0745bbff91afdd1a470564ca272b59bbee308dcb0f7cd9a36dc0094d6e565ba9bda11ca96fb4df7721bccfce42d60811da2c79566933025b8afe5
|
7
|
+
data.tar.gz: a3d9b46b5566bc8bbad7db19e3e4c3e9bea6ac005e2a17f734349ef6a70870a85c324cd43b617c0bd4b32f008c290e605abc6642aac42c44183f5db6bf7ad913
|
@@ -17,11 +17,20 @@ module Smartcloud
|
|
17
17
|
end
|
18
18
|
|
19
19
|
def pack_rails
|
20
|
-
|
21
|
-
|
22
|
-
|
20
|
+
if File.exist? "tmp/smartcloud/packed"
|
21
|
+
begin
|
22
|
+
pid = File.read('tmp/smartcloud/packed').to_i
|
23
|
+
Process.kill('QUIT', pid)
|
24
|
+
rescue Errno::ESRCH # No such process
|
25
|
+
end
|
26
|
+
exec "bundle", "exec", "puma", "--config", "config/puma.rb"
|
27
|
+
else
|
28
|
+
return unless bundle_install?
|
29
|
+
return unless precompile_assets?
|
30
|
+
return unless test_web_server?
|
23
31
|
|
24
|
-
|
32
|
+
exit 0
|
33
|
+
end
|
25
34
|
end
|
26
35
|
|
27
36
|
# Perform bundle install
|
@@ -64,9 +73,13 @@ module Smartcloud
|
|
64
73
|
end
|
65
74
|
end
|
66
75
|
|
67
|
-
# Perform
|
68
|
-
def
|
69
|
-
logger.
|
76
|
+
# Perform testing of web server
|
77
|
+
def test_web_server?
|
78
|
+
logger.info "Setting up Web Server ..."
|
79
|
+
|
80
|
+
# tmp folder
|
81
|
+
FileUtils.mkdir_p("tmp/smartcloud")
|
82
|
+
FileUtils.rm_f("tmp/smartcloud/packed")
|
70
83
|
|
71
84
|
# Spawn Process
|
72
85
|
pid = Process.spawn("bundle", "exec", "puma", "--config", "config/puma.rb")
|
@@ -79,10 +92,10 @@ module Smartcloud
|
|
79
92
|
status = nil
|
80
93
|
begin
|
81
94
|
Process.kill(0, pid)
|
82
|
-
|
95
|
+
system("#{pid}" > "tmp/smartcloud/packed")
|
83
96
|
status = true
|
84
97
|
rescue Errno::ESRCH # No such process
|
85
|
-
|
98
|
+
logger.info "Web Server could not start"
|
86
99
|
status = false
|
87
100
|
end
|
88
101
|
|
@@ -332,10 +332,15 @@ module Smartcloud
|
|
332
332
|
system("docker network connect mysql-network #{new_container}")
|
333
333
|
|
334
334
|
if system("docker start --attach #{new_container}")
|
335
|
-
|
336
|
-
|
337
|
-
|
338
|
-
|
335
|
+
logger.debug "Starting Web Server ..."
|
336
|
+
if system("docker start #{new_container}")
|
337
|
+
sleep 5
|
338
|
+
puts "Web Server started successfully."
|
339
|
+
self.stop_app(old_container)
|
340
|
+
self.clean_up(container_path)
|
341
|
+
logger.info "Launched Application ... Success."
|
342
|
+
exit 10
|
343
|
+
end
|
339
344
|
else
|
340
345
|
self.stop_app("#{new_container}")
|
341
346
|
end
|