Resolved multiple critical discovery system issues: ## Discovery System Fixes - Fixed console commands not being discovered on first run - Implemented fallback discovery for empty caches - Added context-aware caching with separate cache keys - Fixed object serialization preventing __PHP_Incomplete_Class ## Cache System Improvements - Smart caching that only caches meaningful results - Separate caches for different execution contexts (console, web, test) - Proper array serialization/deserialization for cache compatibility - Cache hit logging for debugging and monitoring ## Object Serialization Fixes - Fixed DiscoveredAttribute serialization with proper string conversion - Sanitized additional data to prevent object reference issues - Added fallback for corrupted cache entries ## Performance & Reliability - All 69 console commands properly discovered and cached - 534 total discovery items successfully cached and restored - No more __PHP_Incomplete_Class cache corruption - Improved error handling and graceful fallbacks ## Testing & Quality - Fixed code style issues across discovery components - Enhanced logging for better debugging capabilities - Improved cache validation and error recovery Ready for production deployment with stable discovery system. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
87 lines
2.1 KiB
Bash
Executable File
87 lines
2.1 KiB
Bash
Executable File
#!/bin/bash
|
|
# Server-Setup-Skript für verschiedene Umgebungen
|
|
#!/bin/bash
|
|
|
|
# Server-Setup-Skript für verschiedene Umgebungen
|
|
|
|
# Konfiguration
|
|
ANSIBLE_INVENTORY="ansible/inventory/hosts.ini"
|
|
SETUP_PLAYBOOK="ansible/setup.yml"
|
|
|
|
# Farbdefinitionen
|
|
GREEN="\033[0;32m"
|
|
YELLOW="\033[1;33m"
|
|
RED="\033[0;31m"
|
|
NC="\033[0m" # No Color
|
|
|
|
# Funktion zum Anzeigen von Nachrichten
|
|
echo_msg() {
|
|
echo -e "${GREEN}[SETUP]${NC} $1"
|
|
}
|
|
|
|
echo_warn() {
|
|
echo -e "${YELLOW}[WARNUNG]${NC} $1"
|
|
}
|
|
|
|
echo_error() {
|
|
echo -e "${RED}[FEHLER]${NC} $1"
|
|
}
|
|
|
|
# Parameter auswerten
|
|
ENVIRONMENT="$1"
|
|
TAGS="$2"
|
|
|
|
if [ -z "$ENVIRONMENT" ]; then
|
|
echo_warn "Keine Umgebung angegeben. Verfügbare Optionen:"
|
|
echo " ./bin/setup staging - Staging-Server einrichten"
|
|
echo " ./bin/setup prod - Produktionsserver einrichten"
|
|
echo " ./bin/setup all - Alle Server einrichten"
|
|
exit 1
|
|
fi
|
|
|
|
# Tags zusammenbauen (falls angegeben)
|
|
TAGS_OPTION=""
|
|
if [ -n "$TAGS" ]; then
|
|
TAGS_OPTION="--tags=$TAGS"
|
|
echo_msg "Verwende Tags: $TAGS"
|
|
fi
|
|
|
|
# Limit für die Server-Auswahl
|
|
LIMIT_OPTION=""
|
|
case "$ENVIRONMENT" in
|
|
staging|stage)
|
|
LIMIT_OPTION="--limit=staging"
|
|
echo_msg "Richte Staging-Server ein..."
|
|
;;
|
|
prod|production)
|
|
LIMIT_OPTION="--limit=production"
|
|
echo_msg "Richte Produktionsserver ein..."
|
|
read -p "Sind Sie sicher, dass Sie den Produktionsserver einrichten möchten? (j/N) " -n 1 -r
|
|
echo
|
|
if [[ ! $REPLY =~ ^[Jj]$ ]]; then
|
|
echo_warn "Einrichtung des Produktionsservers abgebrochen."
|
|
exit 1
|
|
fi
|
|
;;
|
|
all)
|
|
echo_msg "Richte alle Server ein..."
|
|
;;
|
|
*)
|
|
echo_error "Unbekannte Umgebung: $ENVIRONMENT"
|
|
exit 1
|
|
;;
|
|
esac
|
|
|
|
# Setup-Playbook ausführen
|
|
echo_msg "Führe Ansible-Playbook aus..."
|
|
ansible-playbook -i "$ANSIBLE_INVENTORY" "$SETUP_PLAYBOOK" $LIMIT_OPTION $TAGS_OPTION
|
|
|
|
# Setup-Status prüfen
|
|
if [ $? -eq 0 ]; then
|
|
echo_msg "Server-Setup erfolgreich abgeschlossen."
|
|
exit 0
|
|
else
|
|
echo_error "Server-Setup fehlgeschlagen! Bitte überprüfen Sie die Logs."
|
|
exit 1
|
|
fi
|