3c2c33f83b
Pack HTML report after publish; link archive in run index and CI log. Add fetch-ci-report.sh helper for agent curl/extract. [skip ci]
26 lines
803 B
Bash
26 lines
803 B
Bash
#!/usr/bin/env bash
|
|
# Download CI report archive from ci-reports server and extract for agent/offline analysis.
|
|
# Usage: fetch-ci-report.sh <report.tar.gz URL> [out_dir]
|
|
# Example:
|
|
# bash scripts/fetch-ci-report.sh \
|
|
# 'https://ci-reports.ift.eventhub.local/EventHubFront/40/allure-ift/report.tar.gz' \
|
|
# ./.tmp-ci-report
|
|
set -euo pipefail
|
|
|
|
URL="${1:?report.tar.gz URL}"
|
|
OUT="${2:-./ci-report-archive}"
|
|
CURL=(curl -fsSL)
|
|
if [[ "${CI_REPORTS_INSECURE:-}" == "1" ]]; then
|
|
CURL+=( -k )
|
|
fi
|
|
|
|
mkdir -p "${OUT}"
|
|
ARCHIVE="${OUT}/report.tar.gz"
|
|
"${CURL[@]}" "${URL}" -o "${ARCHIVE}"
|
|
rm -rf "${OUT}/contents"
|
|
mkdir -p "${OUT}/contents"
|
|
tar -xzf "${ARCHIVE}" -C "${OUT}/contents"
|
|
echo "Archive: ${ARCHIVE}"
|
|
echo "Extracted: ${OUT}/contents"
|
|
echo "Allure index (if present): ${OUT}/contents/index.html"
|