Force logs encoding
This commit is contained in:
@@ -32,7 +32,7 @@ module Pipeline::Build
|
||||
image: image_name,
|
||||
image_tag: image_tag,
|
||||
git_tag: build_tag,
|
||||
logs: img.logs.inspect.force_encoding("ISO-8859-1").encode("UTF-8")
|
||||
logs: img.logs.inspect
|
||||
}
|
||||
end
|
||||
|
||||
|
||||
@@ -56,13 +56,22 @@ module Pipeline::Util
|
||||
{
|
||||
cmd: cmd_string,
|
||||
success: success?,
|
||||
stdout: stdout,
|
||||
stderr: stderr
|
||||
stdout: fix_encoding(stdout),
|
||||
stderr: fix_encoding(stderr)
|
||||
}
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def fix_encoding(text)
|
||||
return nil if text.nil
|
||||
text.force_encoding("ISO-8859-1").encode("UTF-8")
|
||||
rescue => e
|
||||
puts e.message
|
||||
puts e.backtrace
|
||||
"--- failed to encode as UTF-8: #{e.message} ---"
|
||||
end
|
||||
|
||||
def invoke_process
|
||||
c = cmd
|
||||
captured_stdout = []
|
||||
|
||||
Reference in New Issue
Block a user