codigo0/deploy.sh
planetazuzu 1a7f9ae008 feat: organizar imágenes para PWA y adaptar MarkdownViewer
- Organizar 48 imágenes en public/assets/infografias/ por bloques
- Adaptar MarkdownViewer para procesar rutas de imágenes automáticamente
- Actualizar Service Worker para cachear imágenes (offline-first)
- Configurar Vite para incluir imágenes en build
- Crear documentación: guías de integración, sugerencias de medios, estado de imágenes
- Scripts de organización automática de imágenes

Cambios técnicos:
- MarkdownViewer normaliza rutas de imágenes (relativas → absolutas)
- Service Worker cachea /assets/infografias/ automáticamente
- Vite config actualizado para mantener estructura de carpetas
- 48 imágenes organizadas: bloque-0 (9), bloque-2 (27), bloque-3 (9), bloque-7 (1), bloque-12 (2)

Documentación:
- GUIA_INTEGRAR_IMAGENES_PWA.md
- GUIA_RUTAS_IMAGENES_MARKDOWN.md
- SUGERENCIAS_MEDIOS_VISUALES.md
- IMAGENES_NECESARIAS.md
- ESTADO_FINAL_IMAGENES_PWA.md
- RESUMEN_ORGANIZACION_IMAGENES.md
2025-12-19 21:14:20 +01:00

48 lines
1.3 KiB
Bash
Executable file
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/bin/bash
# Script de deploy para EMERGES TES
# Uso: ./deploy.sh
# Requisitos: git, npm, PM2 (opcional)
set -e # Salir si hay error
echo "🚀 Iniciando deploy de EMERGES TES..."
# Colores para output
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
NC='\033[0m' # No Color
# 1. Actualizar código desde git
echo -e "${YELLOW}📥 Actualizando código desde git...${NC}"
git pull origin main || echo "⚠️ No se pudo hacer git pull (continuando...)"
# 2. Instalar dependencias
echo -e "${YELLOW}📦 Instalando dependencias...${NC}"
npm ci --production=false
# 3. Build de producción
echo -e "${YELLOW}🔨 Construyendo aplicación...${NC}"
npm run build
# 4. Verificar que el build se completó
if [ ! -d "dist" ]; then
echo "❌ Error: El directorio dist no existe después del build"
exit 1
fi
echo -e "${GREEN}✅ Build completado exitosamente${NC}"
# 5. Si PM2 está instalado, reiniciar
if command -v pm2 &> /dev/null; then
echo -e "${YELLOW}🔄 Reiniciando PM2...${NC}"
pm2 restart ecosystem.config.js || pm2 start ecosystem.config.js
pm2 save
echo -e "${GREEN}✅ PM2 reiniciado${NC}"
else
echo -e "${YELLOW} PM2 no está instalado. Usa Nginx para servir archivos estáticos.${NC}"
echo -e "${YELLOW} Los archivos están en: $(pwd)/dist${NC}"
fi
echo -e "${GREEN}🎉 Deploy completado!${NC}"