More logging adjustments
Trying to get a nice-looking output
This commit is contained in:
parent
21f9b5c6c8
commit
dbe77ef949
3 changed files with 12 additions and 11 deletions
|
|
@ -16,7 +16,7 @@ module Granblue
|
||||||
end
|
end
|
||||||
|
|
||||||
def download
|
def download
|
||||||
log_info "#{object_type.capitalize} #{@id}"
|
log_info "=> #{@id}"
|
||||||
return if @test_mode
|
return if @test_mode
|
||||||
|
|
||||||
SIZES.each do |size|
|
SIZES.each do |size|
|
||||||
|
|
@ -36,7 +36,7 @@ module Granblue
|
||||||
should_process = should_download?(download_uri, s3_key)
|
should_process = should_download?(download_uri, s3_key)
|
||||||
return unless should_process
|
return unless should_process
|
||||||
|
|
||||||
log_info "-> #{size}:\t#{url}..."
|
log_info "-> #{size}: #{url}..."
|
||||||
|
|
||||||
case @storage
|
case @storage
|
||||||
when :local
|
when :local
|
||||||
|
|
@ -118,7 +118,7 @@ module Granblue
|
||||||
|
|
||||||
filepath = "#{path}/#{filename}"
|
filepath = "#{path}/#{filename}"
|
||||||
download = URI.parse(url).open
|
download = URI.parse(url).open
|
||||||
log_info "\tDownloading #{size}\t#{url}..."
|
log_info "-> #{size}:\t#{url}..."
|
||||||
IO.copy_stream(download, filepath)
|
IO.copy_stream(download, filepath)
|
||||||
rescue OpenURI::HTTPError
|
rescue OpenURI::HTTPError
|
||||||
log_info "\t404 returned\t#{url}"
|
log_info "\t404 returned\t#{url}"
|
||||||
|
|
|
||||||
|
|
@ -30,7 +30,7 @@ class PostDeploymentManager
|
||||||
private
|
private
|
||||||
|
|
||||||
def import_new_data
|
def import_new_data
|
||||||
log_header "Importing new data..."
|
log_header 'Importing new data...'
|
||||||
importer = Granblue::DataImporter.new(
|
importer = Granblue::DataImporter.new(
|
||||||
test_mode: @test_mode,
|
test_mode: @test_mode,
|
||||||
verbose: @verbose
|
verbose: @verbose
|
||||||
|
|
@ -51,7 +51,8 @@ class PostDeploymentManager
|
||||||
end
|
end
|
||||||
|
|
||||||
def rebuild_search_indices
|
def rebuild_search_indices
|
||||||
log_header 'Rebuilding search indices...'
|
log_header 'Rebuilding search indices...', '-'
|
||||||
|
puts "\n"
|
||||||
[Character, Summon, Weapon, Job].each do |model|
|
[Character, Summon, Weapon, Job].each do |model|
|
||||||
log_verbose "• #{model.name}... "
|
log_verbose "• #{model.name}... "
|
||||||
PgSearch::Multisearch.rebuild(model)
|
PgSearch::Multisearch.rebuild(model)
|
||||||
|
|
@ -61,9 +62,9 @@ class PostDeploymentManager
|
||||||
|
|
||||||
def display_import_summary
|
def display_import_summary
|
||||||
if @new_records.size > 0 || @updated_records.size > 0
|
if @new_records.size > 0 || @updated_records.size > 0
|
||||||
log_step "\nImport Summary:"
|
log_header 'Import Summary', '-'
|
||||||
display_record_summary("New", @new_records)
|
display_record_summary('New', @new_records)
|
||||||
display_record_summary("Updated", @updated_records)
|
display_record_summary('Updated', @updated_records)
|
||||||
else
|
else
|
||||||
log_step "\nNo new records imported."
|
log_step "\nNo new records imported."
|
||||||
end
|
end
|
||||||
|
|
@ -83,7 +84,7 @@ class PostDeploymentManager
|
||||||
if @test_mode
|
if @test_mode
|
||||||
log_step "\nTEST MODE: Would download images for new and updated records..."
|
log_step "\nTEST MODE: Would download images for new and updated records..."
|
||||||
else
|
else
|
||||||
log_header "Downloading images...", "+"
|
log_header 'Downloading images...', '+'
|
||||||
end
|
end
|
||||||
|
|
||||||
[@new_records, @updated_records].each do |records|
|
[@new_records, @updated_records].each do |records|
|
||||||
|
|
@ -110,7 +111,7 @@ class PostDeploymentManager
|
||||||
def download_single_image(type, id, options)
|
def download_single_image(type, id, options)
|
||||||
action_text = @test_mode ? 'Would download' : 'Downloading'
|
action_text = @test_mode ? 'Would download' : 'Downloading'
|
||||||
storage_text = STORAGE_DESCRIPTIONS[options[:storage]]
|
storage_text = STORAGE_DESCRIPTIONS[options[:storage]]
|
||||||
log_verbose "#{action_text} images #{storage_text} for #{type} #{id}..."
|
log_verbose "\n#{action_text} images #{storage_text} for #{type} #{id}...\n"
|
||||||
|
|
||||||
Granblue::Downloader::DownloadManager.download_for_object(
|
Granblue::Downloader::DownloadManager.download_for_object(
|
||||||
type,
|
type,
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,7 @@ namespace :deploy do
|
||||||
# Ensure Rails environment is loaded
|
# Ensure Rails environment is loaded
|
||||||
Rails.application.eager_load!
|
Rails.application.eager_load!
|
||||||
|
|
||||||
log_header('Starting post-deploy script...', '*', false)
|
log_header('Starting post-deploy script...', '-', false)
|
||||||
print "\n"
|
print "\n"
|
||||||
|
|
||||||
# Parse and validate storage option
|
# Parse and validate storage option
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue