lib/smartcloud/grids/buildpacker.rb in smartcloud-0.0.171 vs lib/smartcloud/grids/buildpacker.rb in smartcloud-0.0.172
- old
+ new
@@ -9,13 +9,13 @@
def pack
set_logger_formatter_arrow
pack_rails if File.exist? "bin/rails"
- logger.info "Could not continue ... Launch Failed."
+ logger.error "Could not continue ... Launch Failed."
logger.formatter = nil
- exit 1
+ exit 12
end
def pack_rails
return unless bundle_install?
return unless precompile_assets?
@@ -24,10 +24,11 @@
exit 0
end
# Perform bundle install
def bundle_install?
+ logger.info "\n"
logger.info "Performing bundle install ..."
set_logger_formatter_tabs
Open3.popen2("bundle", "install", "--deployment", "--clean") do |stdin, stdout_and_stderr, wait_thr|
stdout_and_stderr.each { |line| logger.info "#{line}" }
return true if wait_thr.value.success?
@@ -37,10 +38,11 @@
return false
end
# Perform pre-compiling of assets
def precompile_assets?
+ logger.info "\n"
logger.info "Installing Javascript dependencies & pre-compiling assets ..."
set_logger_formatter_tabs
Open3.popen2("bundle", "exec", "rails", "assets:precompile") do |stdin, stdout_and_stderr, wait_thr|
stdout_and_stderr.each { |line| logger.info "#{line}" }
return true if wait_thr.value.success?
@@ -50,17 +52,21 @@
return false
end
# Perform starting of web server
def start_web_server?
+ logger.debug "\n"
logger.debug "Starting Web Server ..."
# Remove server.pid if it exists
FileUtils.rm("tmp/pids/server.pid") if File.exist? "tmp/pids/server.pid"
# if system("god -c Godfile -D")
+ logger.info "\n"
logger.info "Launched Application ... Success."
+ # return true
# end
+ return false
end
def set_logger_formatter_arrow
logger.formatter = proc do |severity, datetime, progname, message|
"\t\t\t------> #{severity}: #{message}\n"