Sistema NEXUS v3.4 migrado con: Estructura principal: - core/orchestration: Sistema SIMCO + CAPVED (27 directivas, 28 perfiles) - core/catalog: Catalogo de funcionalidades reutilizables - shared/knowledge-base: Base de conocimiento compartida - devtools/scripts: Herramientas de desarrollo - control-plane/registries: Control de servicios y CI/CD - orchestration/: Configuracion de orquestacion de agentes Proyectos incluidos (11): - gamilit (submodule -> GitHub) - trading-platform (OrbiquanTIA) - erp-suite con 5 verticales: - erp-core, construccion, vidrio-templado - mecanicas-diesel, retail, clinicas - betting-analytics - inmobiliaria-analytics - platform_marketing_content - pos-micro, erp-basico Configuracion: - .gitignore completo para Node.js/Python/Docker - gamilit como submodule (git@github.com:rckrdmrd/gamilit-workspace.git) - Sistema de puertos estandarizado (3005-3199) Generated with NEXUS v3.4 Migration System EPIC-010: Configuracion Git y Repositorios
83 lines
2.3 KiB
Bash
Executable File
83 lines
2.3 KiB
Bash
Executable File
#!/bin/bash
|
|
# =============================================================================
|
|
# validate-environment.sh
|
|
# Valida puertos y configuracion de ambiente para ERP Suite
|
|
# Version: 1.0.0
|
|
# =============================================================================
|
|
|
|
set -e
|
|
|
|
# Colores para output
|
|
RED='\033[0;31m'
|
|
GREEN='\033[0;32m'
|
|
YELLOW='\033[1;33m'
|
|
BLUE='\033[0;34m'
|
|
NC='\033[0m' # No Color
|
|
|
|
# Configuracion de proyectos
|
|
declare -A PROJECTS=(
|
|
["erp-core"]="3000:5173:5432:6379:9000"
|
|
["construccion"]="3100:5174:5433:6380:9100"
|
|
["vidrio-templado"]="3200:5175:5434:6381:9200"
|
|
["mecanicas-diesel"]="3300:5176:5435:6382:9300"
|
|
["retail"]="3400:5177:5436:6383:9400"
|
|
["clinicas"]="3500:5178:5437:6384:9500"
|
|
["trading-platform"]="3600:5179:5438:6385:9600"
|
|
["orbiquantia"]="3700:5180:5439:6386:9700"
|
|
)
|
|
|
|
# Funcion para verificar puerto
|
|
check_port() {
|
|
local port=$1
|
|
if command -v ss &> /dev/null; then
|
|
if ss -tuln | grep -q ":$port "; then
|
|
return 1
|
|
fi
|
|
elif command -v netstat &> /dev/null; then
|
|
if netstat -tuln | grep -q ":$port "; then
|
|
return 1
|
|
fi
|
|
fi
|
|
return 0
|
|
}
|
|
|
|
# Header
|
|
echo ""
|
|
echo -e "${BLUE}=========================================${NC}"
|
|
echo -e "${BLUE} ERP Suite - Validacion de Ambiente ${NC}"
|
|
echo -e "${BLUE}=========================================${NC}"
|
|
echo ""
|
|
|
|
PROJECT_FILTER="${1:-all}"
|
|
total_ok=0
|
|
total_fail=0
|
|
|
|
for project in "${!PROJECTS[@]}"; do
|
|
if [[ "$PROJECT_FILTER" != "all" && "$PROJECT_FILTER" != "$project" ]]; then
|
|
continue
|
|
fi
|
|
|
|
IFS=':' read -r backend frontend db redis minio <<< "${PROJECTS[$project]}"
|
|
|
|
echo -e "${YELLOW}Proyecto: $project${NC}"
|
|
echo "----------------------------------------"
|
|
|
|
for svc_port in "Backend:$backend" "Frontend:$frontend" "Database:$db" "Redis:$redis" "MinIO:$minio"; do
|
|
IFS=':' read -r svc port <<< "$svc_port"
|
|
if check_port $port; then
|
|
printf " %-12s (%s): ${GREEN}OK${NC}\n" "$svc" "$port"
|
|
((total_ok++))
|
|
else
|
|
printf " %-12s (%s): ${RED}OCUPADO${NC}\n" "$svc" "$port"
|
|
((total_fail++))
|
|
fi
|
|
done
|
|
echo ""
|
|
done
|
|
|
|
echo -e "${BLUE}=========================================${NC}"
|
|
echo -e "Resumen: ${GREEN}$total_ok OK${NC} | ${RED}$total_fail OCUPADOS${NC}"
|
|
echo -e "${BLUE}=========================================${NC}"
|
|
|
|
[[ $total_fail -gt 0 ]] && exit 1 || exit 0
|