@@ -55,27 +55,26 @@ function copy-container-files() {
55
55
56
56
function save-container-logs() {
57
57
local base_dest_dir=$1
58
- local output_to_stdout =${2:- }
58
+ local deployment_failed =${2:- }
59
59
60
60
os::log::info " Saving container logs"
61
61
62
- local container_log_file=" /tmp/systemd.log.gz "
62
+ local container_log_file=" /tmp/systemd.log"
63
63
64
64
for container_name in " ${CONTAINER_NAMES[@]} " ; do
65
65
local dest_dir=" ${base_dest_dir} /${container_name} "
66
66
if [[ ! -d " ${dest_dir} " ]]; then
67
67
mkdir -p " ${dest_dir} "
68
68
fi
69
- sudo docker exec -t " ${container_name} " bash -c " journalctl | \
70
- gzip > ${container_log_file} "
69
+ sudo docker exec -t " ${container_name} " bash -c " journalctl > ${container_log_file} "
71
70
sudo docker cp " ${container_name} :${container_log_file} " " ${dest_dir} "
72
- # Output container logs to stdout to ensure that jenkins has
73
- # detail to classify the failure cause.
74
- if [[ -n " ${output_to_stdout} " ]] ; then
71
+ if [[ -n " ${deployment_failed} " ]] ; then
72
+ # Output container logs to stdout to ensure that jenkins has
73
+ # detail to classify the failure cause.
75
74
local msg=" System logs for container ${container_name} "
76
75
os::log::info " < ${msg} >"
77
76
os::log::info " ***************************************************"
78
- gunzip --stdout " ${dest_dir} /$( basename " ${container_log_file} " ) "
77
+ cat " ${dest_dir} /$( basename " ${container_log_file} " ) "
79
78
os::log::info " ***************************************************"
80
79
os::log::info " </ ${msg} >"
81
80
fi
0 commit comments