#!/bin/bash # Script para habilitar el entorno virtual de VoxPopuli Microservices # Colores para output GREEN='\033[0;32m' YELLOW='\033[1;33m' NC='\033[0m' # No Color echo -e "${YELLOW}================================${NC}" echo -e "${YELLOW}VoxPopuli Microservices Setup${NC}" echo -e "${YELLOW}================================${NC}" # Crear entorno virtual si no existe if [ ! -d "venv" ]; then echo -e "${YELLOW}Creando entorno virtual...${NC}" python3 -m venv venv echo -e "${GREEN}✓ Entorno virtual creado${NC}" else echo -e "${GREEN}✓ Entorno virtual ya existe${NC}" fi # Activar entorno virtual echo -e "${YELLOW}Activando entorno virtual...${NC}" source venv/bin/activate echo -e "${GREEN}✓ Entorno virtual activado${NC}" # Instalar dependencias if [ -f "requirements.txt" ]; then echo -e "${YELLOW}Instalando dependencias...${NC}" pip install -r requirements.txt echo -e "${GREEN}✓ Dependencias instaladas${NC}" fi # Verificar archivo .env if [ ! -f ".env" ]; then if [ -f ".env.example" ]; then echo -e "${YELLOW}Creando archivo .env desde .env.example...${NC}" cp .env.example .env echo -e "${YELLOW}⚠ Por favor, actualiza .env con tus credenciales${NC}" fi fi echo echo -e "${GREEN}================================${NC}" echo -e "${GREEN}✓ Setup completado${NC}" echo -e "${GREEN}================================${NC}" echo echo -e "${YELLOW}Para ejecutar los microservicios:${NC}" echo "cd src" echo "python main.py" echo