smartcloud 0.0.170 → 0.0.171
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/smartcloud/grids/buildpacker.rb +51 -27
- data/lib/smartcloud/grids/runner.rb +3 -3
- 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: e156f54f86c83734ce2a079df33131fbe931c06ba14cc40f546f02c0ed591099
|
4
|
+
data.tar.gz: 3fcf9d76b499c06cb4759c99fb057aa594795c08e6b147ed8a80d5d7edbb4936
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 89513317605a7d9fd69a11d563a82f87159e7d253a33f15f3941e3b7f6efd694e0e055e6679ad764c984c0acaab34134e8b86fc34ef4c7235765ed4e22be9e86
|
7
|
+
data.tar.gz: 6638d96afd7517fbb0f453f7578aa650406ed08096dfb9dc001189b9e89ee01ce715165635b7c635210eb3f4e1320642d0091207957160bb569f019253a6882b
|
@@ -7,48 +7,72 @@ module Smartcloud
|
|
7
7
|
end
|
8
8
|
|
9
9
|
def pack
|
10
|
-
|
11
|
-
"\t\t\t------> #{severity}: #{message}\n"
|
12
|
-
end
|
10
|
+
set_logger_formatter_arrow
|
13
11
|
|
14
12
|
pack_rails if File.exist? "bin/rails"
|
15
|
-
logger.info "Could not continue ... Launch Failed."
|
16
13
|
|
14
|
+
logger.info "Could not continue ... Launch Failed."
|
17
15
|
logger.formatter = nil
|
16
|
+
exit 1
|
18
17
|
end
|
19
18
|
|
20
19
|
def pack_rails
|
21
|
-
|
22
|
-
|
20
|
+
return unless bundle_install?
|
21
|
+
return unless precompile_assets?
|
22
|
+
return unless start_web_server?
|
23
|
+
|
24
|
+
exit 0
|
25
|
+
end
|
23
26
|
|
24
|
-
|
27
|
+
# Perform bundle install
|
28
|
+
def bundle_install?
|
25
29
|
logger.info "Performing bundle install ..."
|
26
|
-
|
27
|
-
|
30
|
+
set_logger_formatter_tabs
|
31
|
+
Open3.popen2("bundle", "install", "--deployment", "--clean") do |stdin, stdout_and_stderr, wait_thr|
|
32
|
+
stdout_and_stderr.each { |line| logger.info "#{line}" }
|
33
|
+
return true if wait_thr.value.success?
|
28
34
|
end
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
+
set_logger_formatter_arrow
|
36
|
+
logger.error "Could not complete bundle install. Please check if your Gemfile.lock is upto date."
|
37
|
+
return false
|
38
|
+
end
|
39
|
+
|
40
|
+
# Perform pre-compiling of assets
|
41
|
+
def precompile_assets?
|
42
|
+
logger.info "Installing Javascript dependencies & pre-compiling assets ..."
|
43
|
+
set_logger_formatter_tabs
|
44
|
+
Open3.popen2("bundle", "exec", "rails", "assets:precompile") do |stdin, stdout_and_stderr, wait_thr|
|
45
|
+
stdout_and_stderr.each { |line| logger.info "#{line}" }
|
46
|
+
return true if wait_thr.value.success?
|
35
47
|
end
|
48
|
+
set_logger_formatter_arrow
|
49
|
+
logger.error "Could not install Javascript dependencies or pre-compile assets."
|
50
|
+
return false
|
51
|
+
end
|
52
|
+
|
53
|
+
# Perform starting of web server
|
54
|
+
def start_web_server?
|
55
|
+
logger.debug "Starting Web Server ..."
|
36
56
|
|
37
|
-
if
|
38
|
-
|
39
|
-
end
|
57
|
+
# Remove server.pid if it exists
|
58
|
+
FileUtils.rm("tmp/pids/server.pid") if File.exist? "tmp/pids/server.pid"
|
40
59
|
|
41
|
-
# if system("
|
42
|
-
|
43
|
-
# if system("bundle exec rails assets:precompile", out: File::NULL)
|
44
|
-
# logger.debug "Starting Server ..."
|
45
|
-
# if system("god -c Godfile -D")
|
46
|
-
# logger.info "Launched Application ... Success."
|
47
|
-
# end
|
48
|
-
# # exit 0
|
49
|
-
# end
|
60
|
+
# if system("god -c Godfile -D")
|
61
|
+
logger.info "Launched Application ... Success."
|
50
62
|
# end
|
51
63
|
end
|
64
|
+
|
65
|
+
def set_logger_formatter_arrow
|
66
|
+
logger.formatter = proc do |severity, datetime, progname, message|
|
67
|
+
"\t\t\t------> #{severity}: #{message}\n"
|
68
|
+
end
|
69
|
+
end
|
70
|
+
|
71
|
+
def set_logger_formatter_tabs
|
72
|
+
logger.formatter = proc do |severity, datetime, progname, message|
|
73
|
+
"\t\t\t\t#{message}"
|
74
|
+
end
|
75
|
+
end
|
52
76
|
end
|
53
77
|
end
|
54
78
|
end
|
@@ -327,9 +327,9 @@ module Smartcloud
|
|
327
327
|
--env-file='#{container_path}/env' \
|
328
328
|
--expose='5000' \
|
329
329
|
--volume='#{Smartcloud.config.user_home_path}/.smartcloud/config:#{Smartcloud.config.user_home_path}/.smartcloud/config' \
|
330
|
-
--volume='#{container_path_with_version}:/
|
331
|
-
--volume='#{container_path}/gems:/
|
332
|
-
--workdir='/
|
330
|
+
--volume='#{container_path_with_version}:/app' \
|
331
|
+
--volume='#{container_path}/gems:/app/vendor/bundle' \
|
332
|
+
--workdir='/app' \
|
333
333
|
--restart='always' \
|
334
334
|
--network='nginx-network' \
|
335
335
|
smartcloud/buildpacks/rails", out: File::NULL)
|