workspace/core/devtools/environment/scripts/validate-environment.sh
rckrdmrd ea1879f4ad feat: Initial workspace structure with multi-level Git configuration
- Configure workspace Git repository with comprehensive .gitignore
- Add Odoo as submodule for ERP reference code
- Include documentation: SETUP.md, GIT-STRUCTURE.md
- Add gitignore templates for projects (backend, frontend, database)
- Structure supports independent repos per project/subproject level

Workspace includes:
- core/ - Reusable patterns, modules, orchestration system
- projects/ - Active projects (erp-suite, gamilit, trading-platform, etc.)
- knowledge-base/ - Reference code and patterns (includes Odoo submodule)
- devtools/ - Development tools and templates
- customers/ - Client implementations template

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-08 10:44:23 -06:00

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