Files
life-project-example/scripts/dashboard.sh
T
electron 8ae0eb239a feat: public example of life-project gates system
Public demo of Factory 4 Life project management:

- Gate definitions S0 (spec), S1 (build), S2
  (integration), S3 (production ready)
- Hardware project template with PlatformIO,
  KiCad CI, and Makefile for fab packages
- JSON schema for .kill-life.yaml manifest
- CLI scripts: create-project, validate-gates,
  dashboard with color-coded status output
- Example project: led-controller (S0+S1 passed,
  S2 in progress)
2026-04-07 15:39:30 +02:00

52 lines
1.7 KiB
Bash
Executable File

#!/usr/bin/env bash
set -euo pipefail
# Display dashboard of all Factory 4 Life projects
# Reads project registry from projects/ directory
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
REPO_ROOT="$(dirname "$SCRIPT_DIR")"
PROJECTS_DIR="${REPO_ROOT}/projects"
echo "============================================"
echo " Factory 4 Life — Project Dashboard"
echo " $(date '+%Y-%m-%d %H:%M')"
echo "============================================"
echo ""
printf "%-25s %-10s %-10s %-10s %-10s %-12s\n" "PROJECT" "S0" "S1" "S2" "S3" "CLIENT"
printf "%-25s %-10s %-10s %-10s %-10s %-12s\n" "-------" "--" "--" "--" "--" "------"
for project_file in "${PROJECTS_DIR}"/*.yaml; do
[[ -f "$project_file" ]] || continue
name=$(grep 'project:' "$project_file" | head -1 | awk '{print $2}' | tr -d '"')
client=$(grep 'client:' "$project_file" | head -1 | awk '{print $2}' | tr -d '"')
# Parse inline YAML: s0: { status: passed, date: "..." }
extract_status() { grep " $1:" "$2" | sed 's/.*status: *//;s/[,} ].*//' | tr -d '"'; }
s0=$(extract_status s0 "$project_file")
s1=$(extract_status s1 "$project_file")
s2=$(extract_status s2 "$project_file")
s3=$(extract_status s3 "$project_file")
# Color-code status
format_status() {
case "$1" in
passed) printf "\033[32m%-10s\033[0m" "PASSED" ;;
in_progress) printf "\033[33m%-10s\033[0m" "WIP" ;;
blocked) printf "\033[31m%-10s\033[0m" "BLOCKED" ;;
skipped) printf "\033[90m%-10s\033[0m" "SKIP" ;;
*) printf "%-10s" "PENDING" ;;
esac
}
printf "%-25s " "${name:-unknown}"
format_status "$s0"
format_status "$s1"
format_status "$s2"
format_status "$s3"
printf "%-12s\n" "${client:-}"
done
echo ""