update
This commit is contained in:
@@ -1,9 +1,11 @@
|
||||
# publish_update.ps1 – Upload Installer + Manifest nach Hetzner
|
||||
# publish_update.ps1 - Upload Installer + Manifest nach Hetzner
|
||||
# Laedt in release/ UND release/downloads/ hoch (beide Pfade).
|
||||
|
||||
$ErrorActionPreference = "Stop"
|
||||
$projectRoot = $PSScriptRoot
|
||||
$remoteHost = "root@178.104.51.177"
|
||||
$remotePath = "/root/aza-app/release"
|
||||
$remoteDownloadsPath = "/root/aza-app/release/downloads"
|
||||
$installerPath = Join-Path $projectRoot "dist\installer\aza_desktop_setup.exe"
|
||||
$manifestPath = Join-Path $projectRoot "release\version.json"
|
||||
|
||||
@@ -24,12 +26,22 @@ if (-not (Test-Path $manifestPath)) {
|
||||
Write-Host " version.json OK"
|
||||
|
||||
# --- [2/4] ---
|
||||
Write-Host "[2/4] Installer hochladen..."
|
||||
Write-Host "[2/4] Installer hochladen (release/ und release/downloads/)..."
|
||||
scp "$installerPath" "${remoteHost}:${remotePath}/aza_desktop_setup.exe"
|
||||
if ($LASTEXITCODE -ne 0) {
|
||||
Write-Error "ABBRUCH: Installer-Upload fehlgeschlagen."
|
||||
exit 1
|
||||
}
|
||||
Write-Host " release/ OK"
|
||||
|
||||
# In den oeffentlichen Downloads-Ordner kopieren
|
||||
# (https://api.aza-medwork.ch/downloads/aza_desktop_setup.exe)
|
||||
ssh $remoteHost "cp ${remotePath}/aza_desktop_setup.exe ${remoteDownloadsPath}/aza_desktop_setup.exe"
|
||||
if ($LASTEXITCODE -ne 0) {
|
||||
Write-Warning "Warnung: Kopieren in downloads/ fehlgeschlagen."
|
||||
} else {
|
||||
Write-Host " release/downloads/ OK"
|
||||
}
|
||||
|
||||
# --- [3/4] ---
|
||||
Write-Host "[3/4] Manifest hochladen..."
|
||||
@@ -38,10 +50,28 @@ if ($LASTEXITCODE -ne 0) {
|
||||
Write-Error "ABBRUCH: Manifest-Upload fehlgeschlagen."
|
||||
exit 1
|
||||
}
|
||||
Write-Host " version.json OK"
|
||||
|
||||
# --- [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/downloads/aza_desktop_setup.exe | head -3; echo '---'; curl -sI https://api.aza-medwork.ch/download/version.json | head -3"
|
||||
Write-Host "[4/4] Remote-Verifizierung (Groesse + SHA256-Abgleich)..."
|
||||
ssh $remoteHost "ls -lh ${remotePath}/aza_desktop_setup.exe && ls -lh ${remoteDownloadsPath}/aza_desktop_setup.exe && ls -lh ${remotePath}/version.json"
|
||||
|
||||
Write-Host ""
|
||||
Write-Host " SHA256-Vergleich (release/ vs. downloads/)..."
|
||||
$hashOutput = ssh $remoteHost "sha256sum ${remotePath}/aza_desktop_setup.exe ${remoteDownloadsPath}/aza_desktop_setup.exe 2>/dev/null"
|
||||
Write-Host $hashOutput
|
||||
|
||||
$hashes = $hashOutput -split "`n" | Where-Object { $_ -match "^[0-9a-f]{64}" } | ForEach-Object { ($_ -split "\s+")[0] }
|
||||
if ($hashes.Count -eq 2 -and $hashes[0] -eq $hashes[1]) {
|
||||
Write-Host " SHA256 identisch: beide Pfade OK." -ForegroundColor Green
|
||||
} elseif ($hashes.Count -lt 2) {
|
||||
Write-Warning " SHA256 konnte nicht verglichen werden (Dateien fehlen?)."
|
||||
} else {
|
||||
Write-Error "WARNUNG: SHA256 der oeffentlichen URL weicht ab! release/downloads/ wurde moeglicherweise nicht aktualisiert."
|
||||
}
|
||||
|
||||
Write-Host ""
|
||||
ssh $remoteHost "curl -sI https://api.aza-medwork.ch/downloads/aza_desktop_setup.exe | head -4"
|
||||
|
||||
Write-Host ""
|
||||
Write-Host "UPLOAD FERTIG"
|
||||
|
||||
Reference in New Issue
Block a user