This repository has been archived on 2026-02-15. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
breakpilot-pwa/scripts/status.sh
Benjamin Admin 21a844cb8a fix: Restore all files lost during destructive rebase
A previous `git pull --rebase origin main` dropped 177 local commits,
losing 3400+ files across admin-v2, backend, studio-v2, website,
klausur-service, and many other services. The partial restore attempt
(660295e2) only recovered some files.

This commit restores all missing files from pre-rebase ref 98933f5e
while preserving post-rebase additions (night-scheduler, night-mode UI,
NightModeWidget dashboard integration).

Restored features include:
- AI Module Sidebar (FAB), OCR Labeling, OCR Compare
- GPU Dashboard, RAG Pipeline, Magic Help
- Klausur-Korrektur (8 files), Abitur-Archiv (5+ files)
- Companion, Zeugnisse-Crawler, Screen Flow
- Full backend, studio-v2, website, klausur-service
- All compliance SDKs, agent-core, voice-service
- CI/CD configs, documentation, scripts

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-09 09:51:32 +01:00

133 lines
3.9 KiB
Bash
Executable File

#!/bin/bash
# ============================================
# BreakPilot Status Overview
# ============================================
# Shows current environment, git branch, and service status
#
# Usage: ./scripts/status.sh
# ============================================
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
ROOT_DIR="$(dirname "$SCRIPT_DIR")"
# Colors
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
RED='\033[0;31m'
BLUE='\033[0;34m'
CYAN='\033[0;36m'
NC='\033[0m'
cd "$ROOT_DIR"
echo -e "${BLUE}========================================${NC}"
echo -e "${BLUE} BreakPilot Status${NC}"
echo -e "${BLUE}========================================${NC}"
echo ""
# Current Environment
echo -e "${CYAN}Environment:${NC}"
if [ -f .env ]; then
CURRENT_ENV=$(grep "^ENVIRONMENT=" .env 2>/dev/null | cut -d= -f2)
PROJECT_NAME=$(grep "^COMPOSE_PROJECT_NAME=" .env 2>/dev/null | cut -d= -f2)
case $CURRENT_ENV in
development)
echo -e " Active: ${GREEN}$CURRENT_ENV${NC}"
;;
staging)
echo -e " Active: ${YELLOW}$CURRENT_ENV${NC}"
;;
production)
echo -e " Active: ${RED}$CURRENT_ENV${NC}"
;;
*)
echo -e " Active: ${CURRENT_ENV:-unknown}"
;;
esac
echo " Project: ${PROJECT_NAME:-not set}"
else
echo -e " ${YELLOW}Not configured (.env missing)${NC}"
echo " Run: ./scripts/env-switch.sh dev"
fi
echo ""
# Git Status
echo -e "${CYAN}Git:${NC}"
if [ -d .git ]; then
BRANCH=$(git branch --show-current 2>/dev/null || echo "unknown")
case $BRANCH in
develop)
echo -e " Branch: ${GREEN}$BRANCH${NC} (development)"
;;
staging)
echo -e " Branch: ${YELLOW}$BRANCH${NC} (staging)"
;;
main)
echo -e " Branch: ${RED}$BRANCH${NC} (production)"
;;
*)
echo " Branch: $BRANCH"
;;
esac
# Check for uncommitted changes
if git diff-index --quiet HEAD -- 2>/dev/null; then
echo -e " Status: ${GREEN}Clean${NC}"
else
CHANGES=$(git status --porcelain | wc -l | tr -d ' ')
echo -e " Status: ${YELLOW}$CHANGES uncommitted change(s)${NC}"
fi
else
echo -e " ${YELLOW}Not a git repository${NC}"
echo " Run: git init"
fi
echo ""
# Docker Status
echo -e "${CYAN}Services:${NC}"
if command -v docker &> /dev/null; then
RUNNING=$(docker compose ps --format "table {{.Name}}\t{{.Status}}" 2>/dev/null | tail -n +2 | wc -l | tr -d ' ')
if [ "$RUNNING" -gt 0 ]; then
echo " Running: $RUNNING container(s)"
echo ""
docker compose ps --format "table {{.Name}}\t{{.Status}}\t{{.Ports}}" 2>/dev/null | head -15
TOTAL=$(docker compose ps -a --format "{{.Name}}" 2>/dev/null | wc -l | tr -d ' ')
if [ "$TOTAL" -gt 14 ]; then
echo " ... and $((TOTAL - 14)) more"
fi
else
echo -e " ${YELLOW}No services running${NC}"
echo " Start with: ./scripts/start.sh dev"
fi
else
echo -e " ${RED}Docker not available${NC}"
fi
echo ""
# Database Volumes
echo -e "${CYAN}Database Volumes:${NC}"
docker volume ls --format "{{.Name}}" 2>/dev/null | grep -E "(postgres|breakpilot.*postgres)" | while read vol; do
case $vol in
*staging*)
echo -e " ${YELLOW}$vol${NC}"
;;
*prod*)
echo -e " ${RED}$vol${NC}"
;;
*)
echo -e " ${GREEN}$vol${NC}"
;;
esac
done || echo " No database volumes found"
echo ""
# Quick Commands
echo -e "${CYAN}Quick Commands:${NC}"
echo " Switch env: ./scripts/env-switch.sh [dev|staging]"
echo " Start: ./scripts/start.sh [dev|staging]"
echo " Stop: ./scripts/stop.sh [dev|staging]"
echo " Promote: ./scripts/promote.sh [dev-to-staging|staging-to-prod]"
echo " Logs: docker compose logs -f [service]"