Force logs encoding
This commit is contained in:
@@ -32,7 +32,7 @@ module Pipeline::Build
|
|||||||
image: image_name,
|
image: image_name,
|
||||||
image_tag: image_tag,
|
image_tag: image_tag,
|
||||||
git_tag: build_tag,
|
git_tag: build_tag,
|
||||||
logs: img.logs.inspect.force_encoding("ISO-8859-1").encode("UTF-8")
|
logs: img.logs.inspect
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -56,13 +56,22 @@ module Pipeline::Util
|
|||||||
{
|
{
|
||||||
cmd: cmd_string,
|
cmd: cmd_string,
|
||||||
success: success?,
|
success: success?,
|
||||||
stdout: stdout,
|
stdout: fix_encoding(stdout),
|
||||||
stderr: stderr
|
stderr: fix_encoding(stderr)
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
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
|
def invoke_process
|
||||||
c = cmd
|
c = cmd
|
||||||
captured_stdout = []
|
captured_stdout = []
|
||||||
|
|||||||
Reference in New Issue
Block a user