diff --git a/bindep.txt b/bindep.txt index e2b047351c..d18f11f7ae 100644 --- a/bindep.txt +++ b/bindep.txt @@ -10,6 +10,9 @@ # will fall back to installing its default packages which # will potentially be detrimental to the tests executed. +# Required for compressing collected log files in CI +gzip + # Requirements for Paramiko 2.0 libssl-dev [platform:dpkg] libffi-dev [platform:dpkg] diff --git a/scripts/scripts-library.sh b/scripts/scripts-library.sh index 77f6538a5b..35923025f2 100755 --- a/scripts/scripts-library.sh +++ b/scripts/scripts-library.sh @@ -137,8 +137,16 @@ function gate_job_exit_tasks { if [[ -d "/etc/nodepool" ]];then GATE_LOG_DIR="$(dirname "${0}")/../logs" mkdir -p "${GATE_LOG_DIR}/host" "${GATE_LOG_DIR}/openstack" - rsync -av --ignore-errors /var/log/ "${GATE_LOG_DIR}/host" || true - rsync -av --ignore-errors /openstack/log/ "${GATE_LOG_DIR}/openstack" || true + rsync --archive --verbose --safe-links --ignore-errors /var/log/ "${GATE_LOG_DIR}/host" || true + rsync --archive --verbose --safe-links --ignore-errors /openstack/log/ "${GATE_LOG_DIR}/openstack" || true + # Rename all files gathered to have a .txt suffix so that the compressed + # files are viewable via a web browser in OpenStack-CI. + find "${GATE_LOG_DIR}/" -type f -exec mv {} {}.txt \; + # Compress the files gathered so that they do not take up too much space. + # We use 'command' to ensure that we're not executing with some sort of alias. + command gzip --best --recursive "${GATE_LOG_DIR}/" + # Ensure that the files are readable by all users, including the non-root + # OpenStack-CI jenkins user. chmod -R 0777 "${GATE_LOG_DIR}" fi }