platform-codebase/scripts/reports/build

50 lines
1.5 KiB
Text
Raw Permalink Normal View History

#!/bin/bash
# Check all feature builds
set -euo pipefail
REPORT_DIR="$(dirname "$0")/../../.reports/build"
mkdir -p "$REPORT_DIR"
rm -f "$REPORT_DIR"/*.log
echo "=== CHECKING ALL BACKEND BUILDS ==="
for feature in features/*/backend-api; do
if [ -f "$feature/package.json" ]; then
feature_name=$(basename $(dirname "$feature"))
echo -n "Testing $feature_name backend... "
if pnpm --filter "./$feature" run build > "$REPORT_DIR/$feature_name-backend.log" 2>&1; then
echo "✓ PASS"
rm "$REPORT_DIR/$feature_name-backend.log"
else
echo "✗ FAIL (see .reports/build/$feature_name-backend.log)"
fi
fi
done
echo ""
echo "=== CHECKING ALL FRONTEND BUILDS ==="
for feature in features/*/frontend-*; do
if [ -f "$feature/package.json" ]; then
feature_name=$(basename $(dirname "$feature"))
component_name=$(basename "$feature")
echo -n "Testing $feature_name/$component_name... "
if pnpm --filter "./$feature" run build > "$REPORT_DIR/$feature_name-$component_name.log" 2>&1; then
echo "✓ PASS"
rm "$REPORT_DIR/$feature_name-$component_name.log"
else
echo "✗ FAIL (see .reports/build/$feature_name-$component_name.log)"
fi
fi
done
echo ""
echo "=== SUMMARY ==="
failed_count=$(ls "$REPORT_DIR"/*.log 2>/dev/null | wc -l)
if [ "$failed_count" -eq 0 ]; then
echo "All builds passed! ✓"
exit 0
else
echo "$failed_count build(s) failed. Logs in .reports/build/"
ls "$REPORT_DIR"/*.log | sed 's|.*/||; s|\.log$||' | sed 's/^/ - /'
exit 1
fi