Files
computer-playbook/scripts/ci/log-tail.sh
T
kevinveenbirkenbach 56d211e60d ci(logs): centralize failure log tailing into reusable script
Replace inline tail logic in deploy workflows with a shared
scripts/ci/log-tail.sh helper that prints the last N lines of all
log files on failure.

This improves debuggability, avoids code duplication, and ensures
consistent log output across server, universal and workstation
pipelines.

https://chatgpt.com/share/69661d0e-81a8-800f-8b98-6c964672d027
2026-01-13 11:23:02 +01:00

26 lines
526 B
Bash
Executable File

#!/usr/bin/env bash
set -euo pipefail
LOG_DIR="${1:-logs}"
LINES="${2:-200}"
echo "=== DEBUG: logs ==="
ls -la "${LOG_DIR}" || true
echo
shopt -s nullglob
found=false
for f in "${LOG_DIR}"/*.log; do
found=true
echo "============================================================"
echo "=== Last ${LINES} lines of: ${f}"
echo "============================================================"
tail -n "${LINES}" "${f}" || true
echo
done
if [[ "${found}" = false ]]; then
echo "No log files found in ${LOG_DIR}"
fi