feat: deploy.ps1 para Windows en los 4 packs + INSTALL.md #1

Merged
hermes merged 3 commits from feat/windows-powershell into main 2026-09-12 19:08:48 +02:00
4 changed files with 34 additions and 16 deletions
Showing only changes of commit d192e3c434 - Show all commits

No files matched your search

+7 -4
View File
@@ -63,7 +63,9 @@ if (-not (Get-Command docker -ErrorAction SilentlyContinue)) {
Write-Host ' https://docs.docker.com/desktop/setup/install/windows-install/' Write-Host ' https://docs.docker.com/desktop/setup/install/windows-install/'
exit 1 exit 1
} }
try { docker info *> $null } catch { # En PS 5.1, *> $null sobre comandos nativos convierte stderr en errores
# terminantes con EAP=Stop (PS #4002). Se descarta via cmd /c.
if (-not (cmd /c "docker info >NUL 2>&1")) {
Err 'Docker Desktop no responde. Abre Docker Desktop y espera a que arranque.' Err 'Docker Desktop no responde. Abre Docker Desktop y espera a que arranque.'
exit 1 exit 1
} }
@@ -107,7 +109,8 @@ if (-not $running) {
Warn ' Esperando a que Ollama arranque...' Warn ' Esperando a que Ollama arranque...'
$MaxWait = 60; $Waited = 0 $MaxWait = 60; $Waited = 0
while ($true) { while ($true) {
docker exec d0a1-hermes-ollama ollama ps *> $null # Descarte de stderr via cmd /c (ver nota de PS 5.1 / PS #4002 arriba)
cmd /c "docker exec d0a1-hermes-ollama ollama ps >NUL 2>&1"
if ($LASTEXITCODE -eq 0) { break } if ($LASTEXITCODE -eq 0) { break }
Start-Sleep -Seconds 2 Start-Sleep -Seconds 2
$Waited += 2 $Waited += 2
@@ -124,7 +127,7 @@ Ok "Ollama corriendo en http://localhost:${OllamaPort}"
# --- 2. Instalar Hermes Agent ------------------------------------------------ # --- 2. Instalar Hermes Agent ------------------------------------------------
Warn '[2/3] Instalando Hermes Agent...' Warn '[2/3] Instalando Hermes Agent...'
if (Get-Command hermes -ErrorAction SilentlyContinue) { if (Get-Command hermes -ErrorAction SilentlyContinue) {
Ok "Hermes Agent ya instalado: $(hermes --version 2>$null)" Ok "Hermes Agent ya instalado: $(cmd /c 'hermes --version 2>NUL')"
} else { } else {
# En Windows: instala con winget o pip. El install.sh de Linux no aplica. # En Windows: instala con winget o pip. El install.sh de Linux no aplica.
Write-Host ' Instalando con pip (requiere Python 3.10+)...' Write-Host ' Instalando con pip (requiere Python 3.10+)...'
@@ -134,7 +137,7 @@ if (Get-Command hermes -ErrorAction SilentlyContinue) {
Write-Host ' https://hermes-agent.nousresearch.com/docs' Write-Host ' https://hermes-agent.nousresearch.com/docs'
exit 1 exit 1
} }
Ok "Hermes Agent instalado: $(hermes --version 2>$null)" Ok "Hermes Agent instalado: $(cmd /c 'hermes --version 2>NUL')"
} }
# --- 3. Configurar ------------------------------------------------------------ # --- 3. Configurar ------------------------------------------------------------
+7 -4
View File
@@ -63,7 +63,9 @@ if (-not (Get-Command docker -ErrorAction SilentlyContinue)) {
Write-Host ' https://docs.docker.com/desktop/setup/install/windows-install/' Write-Host ' https://docs.docker.com/desktop/setup/install/windows-install/'
exit 1 exit 1
} }
try { docker info *> $null } catch { # En PS 5.1, *> $null sobre comandos nativos convierte stderr en errores
# terminantes con EAP=Stop (PS #4002). Se descarta via cmd /c.
if (-not (cmd /c "docker info >NUL 2>&1")) {
Err 'Docker Desktop no responde. Abre Docker Desktop y espera a que arranque.' Err 'Docker Desktop no responde. Abre Docker Desktop y espera a que arranque.'
exit 1 exit 1
} }
@@ -107,7 +109,8 @@ if (-not $running) {
Warn ' Esperando a que Ollama arranque...' Warn ' Esperando a que Ollama arranque...'
$MaxWait = 60; $Waited = 0 $MaxWait = 60; $Waited = 0
while ($true) { while ($true) {
docker exec d0a1-openclaw-ollama ollama ps *> $null # Descarte de stderr via cmd /c (ver nota de PS 5.1 / PS #4002 arriba)
cmd /c "docker exec d0a1-openclaw-ollama ollama ps >NUL 2>&1"
if ($LASTEXITCODE -eq 0) { break } if ($LASTEXITCODE -eq 0) { break }
Start-Sleep -Seconds 2 Start-Sleep -Seconds 2
$Waited += 2 $Waited += 2
@@ -124,7 +127,7 @@ Ok "Ollama corriendo en http://localhost:${OllamaPort}"
# --- 2. Instalar OpenClaw ----------------------------------------------------- # --- 2. Instalar OpenClaw -----------------------------------------------------
Warn '[2/3] Instalando OpenClaw...' Warn '[2/3] Instalando OpenClaw...'
if (Get-Command openclaw -ErrorAction SilentlyContinue) { if (Get-Command openclaw -ErrorAction SilentlyContinue) {
Ok "OpenClaw ya instalado: $(openclaw --version 2>$null)" Ok "OpenClaw ya instalado: $(cmd /c 'openclaw --version 2>NUL')"
} else { } else {
# En Windows: instala con npm (Node 18+). El install.sh de Linux no aplica. # En Windows: instala con npm (Node 18+). El install.sh de Linux no aplica.
Write-Host ' Instalando con npm (requiere Node.js 18+)...' Write-Host ' Instalando con npm (requiere Node.js 18+)...'
@@ -134,7 +137,7 @@ if (Get-Command openclaw -ErrorAction SilentlyContinue) {
Write-Host ' https://openclaw.ai/docs' Write-Host ' https://openclaw.ai/docs'
exit 1 exit 1
} }
Ok "OpenClaw instalado: $(openclaw --version 2>$null)" Ok "OpenClaw instalado: $(cmd /c 'openclaw --version 2>NUL')"
} }
# --- 3. Configurar ------------------------------------------------------------ # --- 3. Configurar ------------------------------------------------------------
+10 -4
View File
@@ -61,16 +61,21 @@ if (-not (Get-Command docker -ErrorAction SilentlyContinue)) {
Write-Host ' https://docs.docker.com/desktop/setup/install/windows-install/' Write-Host ' https://docs.docker.com/desktop/setup/install/windows-install/'
exit 1 exit 1
} }
try { docker info *> $null } catch { # En PS 5.1, *> $null sobre comandos nativos convierte stderr en errores
# terminantes con EAP=Stop (PS #4002). Se descarta via cmd /c.
if (-not (cmd /c "docker info >NUL 2>&1")) {
Err 'Docker Desktop no responde. Abre Docker Desktop y espera a que arranque.' Err 'Docker Desktop no responde. Abre Docker Desktop y espera a que arranque.'
exit 1 exit 1
} }
try { docker compose version *> $null; $composeOk = $true } catch { $composeOk = $false } # En PS 5.1, *> $null sobre comandos nativos convierte stderr en errores
# terminantes con EAP=Stop (PS #4002). Se descarta via cmd /c.
cmd /c "docker compose version >NUL 2>&1"
$composeOk = ($LASTEXITCODE -eq 0)
if (-not $composeOk) { if (-not $composeOk) {
Err 'Docker Compose v2 no disponible. Actualiza Docker Desktop.' Err 'Docker Compose v2 no disponible. Actualiza Docker Desktop.'
exit 1 exit 1
} }
Ok "Docker: $(docker compose version --short 2>$null)" Ok "Docker: $(cmd /c 'docker compose version --short 2>NUL')"
# --- Check RAM ------------------------------------------------------------ # --- Check RAM ------------------------------------------------------------
$TotalRamGb = [math]::Round((Get-CimInstance Win32_ComputerSystem).TotalPhysicalMemory / 1GB, 1) $TotalRamGb = [math]::Round((Get-CimInstance Win32_ComputerSystem).TotalPhysicalMemory / 1GB, 1)
@@ -116,7 +121,8 @@ if ($LASTEXITCODE -ne 0) { Err "docker compose up fallo (exit $LASTEXITCODE).";
Warn 'Descargando modelo de IA (llama3.2:3b, ~2 GB)...' Warn 'Descargando modelo de IA (llama3.2:3b, ~2 GB)...'
$MaxWait = 60; $Waited = 0 $MaxWait = 60; $Waited = 0
while ($true) { while ($true) {
docker exec d0a1-ollama ollama ps *> $null # Descarte de stderr via cmd /c (ver nota de PS 5.1 / PS #4002 arriba)
cmd /c "docker exec d0a1-ollama ollama ps >NUL 2>&1"
if ($LASTEXITCODE -eq 0) { break } if ($LASTEXITCODE -eq 0) { break }
Start-Sleep -Seconds 2 Start-Sleep -Seconds 2
$Waited += 2 $Waited += 2
+10 -4
View File
@@ -61,16 +61,21 @@ if (-not (Get-Command docker -ErrorAction SilentlyContinue)) {
Write-Host ' https://docs.docker.com/desktop/setup/install/windows-install/' Write-Host ' https://docs.docker.com/desktop/setup/install/windows-install/'
exit 1 exit 1
} }
try { docker info *> $null } catch { # En PS 5.1, *> $null sobre comandos nativos convierte stderr en errores
# terminantes con EAP=Stop (PS #4002). Se descarta via cmd /c.
if (-not (cmd /c "docker info >NUL 2>&1")) {
Err 'Docker Desktop no responde. Abre Docker Desktop y espera a que arranque.' Err 'Docker Desktop no responde. Abre Docker Desktop y espera a que arranque.'
exit 1 exit 1
} }
try { docker compose version *> $null; $composeOk = $true } catch { $composeOk = $false } # En PS 5.1, *> $null sobre comandos nativos convierte stderr en errores
# terminantes con EAP=Stop (PS #4002). Se descarta via cmd /c.
cmd /c "docker compose version >NUL 2>&1"
$composeOk = ($LASTEXITCODE -eq 0)
if (-not $composeOk) { if (-not $composeOk) {
Err 'Docker Compose v2 no disponible. Actualiza Docker Desktop.' Err 'Docker Compose v2 no disponible. Actualiza Docker Desktop.'
exit 1 exit 1
} }
Ok "Docker: $(docker compose version --short 2>$null)" Ok "Docker: $(cmd /c 'docker compose version --short 2>NUL')"
# --- Check RAM ------------------------------------------------------------ # --- Check RAM ------------------------------------------------------------
$TotalRamGb = [math]::Round((Get-CimInstance Win32_ComputerSystem).TotalPhysicalMemory / 1GB, 1) $TotalRamGb = [math]::Round((Get-CimInstance Win32_ComputerSystem).TotalPhysicalMemory / 1GB, 1)
@@ -154,7 +159,8 @@ if ($LASTEXITCODE -ne 0) { Err "docker compose up fallo (exit $LASTEXITCODE).";
Warn 'Descargando modelo de IA (llama3.2:3b, ~2 GB)...' Warn 'Descargando modelo de IA (llama3.2:3b, ~2 GB)...'
$MaxWait = 60; $Waited = 0 $MaxWait = 60; $Waited = 0
while ($true) { while ($true) {
docker exec d0a1-wp-ollama ollama ps *> $null # Descarte de stderr via cmd /c (ver nota de PS 5.1 / PS #4002 arriba)
cmd /c "docker exec d0a1-wp-ollama ollama ps >NUL 2>&1"
if ($LASTEXITCODE -eq 0) { break } if ($LASTEXITCODE -eq 0) { break }
Start-Sleep -Seconds 2 Start-Sleep -Seconds 2
$Waited += 2 $Waited += 2