Files
aza/AzA march 2026 - Kopie (8)/publish_update.ps1
2026-04-16 13:32:32 +02:00

49 lines
1.6 KiB
PowerShell
Raw Blame History

This file contains ambiguous Unicode characters
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.
# publish_update.ps1 Upload Installer + Manifest nach Hetzner
$ErrorActionPreference = "Stop"
$projectRoot = $PSScriptRoot
$remoteHost = "root@178.104.51.177"
$remotePath = "/root/aza-app/release"
$installerPath = Join-Path $projectRoot "dist\installer\aza_desktop_setup.exe"
$manifestPath = Join-Path $projectRoot "release\version.json"
Write-Host ""
# --- [1/4] ---
Write-Host "[1/4] Lokale Dateien pruefen..."
if (-not (Test-Path $installerPath)) {
Write-Error "ABBRUCH: $installerPath nicht gefunden."
exit 1
}
$sizeMB = [math]::Round((Get-Item $installerPath).Length / 1MB, 2)
Write-Host " Installer OK ($sizeMB MB)"
if (-not (Test-Path $manifestPath)) {
Write-Error "ABBRUCH: $manifestPath nicht gefunden."
exit 1
}
Write-Host " version.json OK"
# --- [2/4] ---
Write-Host "[2/4] Installer hochladen..."
scp "$installerPath" "${remoteHost}:${remotePath}/aza_desktop_setup.exe"
if ($LASTEXITCODE -ne 0) {
Write-Error "ABBRUCH: Installer-Upload fehlgeschlagen."
exit 1
}
# --- [3/4] ---
Write-Host "[3/4] Manifest hochladen..."
scp "$manifestPath" "${remoteHost}:${remotePath}/version.json"
if ($LASTEXITCODE -ne 0) {
Write-Error "ABBRUCH: Manifest-Upload fehlgeschlagen."
exit 1
}
# --- [4/4] ---
Write-Host "[4/4] Remote-Verifizierung..."
ssh $remoteHost "ls -lh ${remotePath}/aza_desktop_setup.exe; ls -lh ${remotePath}/version.json; echo '---'; curl -sI https://api.aza-medwork.ch/download/aza_desktop_setup.exe | head -3; echo '---'; curl -sI https://api.aza-medwork.ch/download/version.json | head -3"
Write-Host ""
Write-Host "UPLOAD FERTIG"
Write-Host ""