lib/smartcloud/grids/buildpacker.rb in smartcloud-0.0.173 vs lib/smartcloud/grids/buildpacker.rb in smartcloud-0.0.174
- old
+ new
@@ -26,32 +26,46 @@
# Perform bundle install
def bundle_install?
logger.info ""
logger.info "Performing bundle install ..."
+
set_logger_formatter_tabs
+ exit_status = nil
Open3.popen2e("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?
+ exit_status = wait_thr.value.success?
end
set_logger_formatter_arrow
- logger.error "Could not complete bundle install."
- return false
+
+ if exit_status
+ return true
+ else
+ logger.error "Could not complete bundle install."
+ return false
+ end
end
# Perform pre-compiling of assets
def precompile_assets?
logger.info ""
logger.info "Installing Javascript dependencies & pre-compiling assets ..."
+
set_logger_formatter_tabs
+ exit_status = nil
Open3.popen2e("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?
+ exit_status = wait_thr.value.success?
end
set_logger_formatter_arrow
- logger.error "Could not install Javascript dependencies or pre-compile assets."
- return false
+
+ if exit_status
+ return true
+ else
+ logger.error "Could not install Javascript dependencies or pre-compile assets."
+ return false
+ end
end
# Perform starting of web server
def start_web_server?
logger.debug ""
@@ -68,16 +82,17 @@
return false
end
def set_logger_formatter_arrow
logger.formatter = proc do |severity, datetime, progname, message|
- "\t\t\t------> #{severity}: #{message}\n"
+ severity_text = (severity == 'INFO') ? " " : "#{severity}:"
+ "\t\t\t------> #{severity_text} #{message}\n"
end
end
def set_logger_formatter_tabs
logger.formatter = proc do |severity, datetime, progname, message|
- "\t\t\t\t#{message}"
+ "\t\t\t\t #{message}"
end
end
end
end
end