# ============================================================================== # Upload RC1 Artifacts & Build Manifest to Tokyo VPS # ============================================================================== $ErrorActionPreference = "Stop" $VpsHost = "158.179.179.29" $SshKey = "C:\Users\Administrator\.ssh\id_rsa_tokyo" $SnapshotId = "20260922-122540-F11B5273" $LocalRcDir = "C:\Users\Administrator\.gemini\antigravity\scratch\ClassNotify\rc_artifacts" Write-Host "==========================================================" -ForegroundColor Cyan Write-Host " Uploading RC1 Artifacts & Manifest to Tokyo VPS " -ForegroundColor Cyan Write-Host "==========================================================" -ForegroundColor Cyan # 1. Create remote target directories $sshCmdInit = "mkdir -p /srv/classnotify-audit/rc1 /srv/classnotify-audit/snapshot/$SnapshotId" ssh -n -o BatchMode=yes -o ConnectTimeout=30 -i $SshKey -o StrictHostKeyChecking=no "root@${VpsHost}" $sshCmdInit if ($LASTEXITCODE -ne 0) { throw "Failed to create remote directory" } # 2. Upload manifest first Write-Host "`n[1/3] Uploading P1_RC1_BUILD_MANIFEST.json..." -ForegroundColor Yellow $localManifest = Join-Path $LocalRcDir "P1_RC1_BUILD_MANIFEST.json" scp -B -o BatchMode=yes -o ConnectTimeout=30 -i $SshKey -o StrictHostKeyChecking=no ` $localManifest ` "root@${VpsHost}:/srv/classnotify-audit/rc1/P1_RC1_BUILD_MANIFEST.json" if ($LASTEXITCODE -ne 0) { throw "Failed to upload manifest to rc1" } # 3. Upload all artifacts Write-Host "`n[2/3] Uploading RC1 binary artifacts (~211 MB)..." -ForegroundColor Yellow $artifacts = @( "ClassNotifySetup.exe", "ClassNotify.Service.exe", "ClassNotify.Client.exe", "ClassNotify.Server-linux-arm64.tar.gz", "ClassNotify.Web-assets.zip" ) foreach ($art in $artifacts) { $artPath = Join-Path $LocalRcDir $art Write-Host " Uploading $art ($([math]::Round((Get-Item $artPath).Length / 1MB, 2)) MB)..." -ForegroundColor White scp -B -o BatchMode=yes -o ConnectTimeout=120 -i $SshKey -o StrictHostKeyChecking=no ` $artPath ` "root@${VpsHost}:/srv/classnotify-audit/rc1/$art" if ($LASTEXITCODE -ne 0) { throw "Failed to upload $art" } } # 4. Link/copy to snapshot directory and verify remote hashes Write-Host "`n[3/3] Synchronizing to snapshot directory and verifying remote hashes..." -ForegroundColor Yellow $remoteVerifyCmd = @" set -e cp -p /srv/classnotify-audit/rc1/* /srv/classnotify-audit/snapshot/$SnapshotId/ chmod -R 755 /srv/classnotify-audit/rc1 /srv/classnotify-audit/snapshot/$SnapshotId systemctl restart caddy echo '--- Remote SHA256 Checksums in /srv/classnotify-audit/rc1 ---' cd /srv/classnotify-audit/rc1 sha256sum P1_RC1_BUILD_MANIFEST.json ClassNotifySetup.exe ClassNotify.Service.exe ClassNotify.Client.exe ClassNotify.Server-linux-arm64.tar.gz ClassNotify.Web-assets.zip echo '--- Remote SHA256 Checksums in /srv/classnotify-audit/snapshot/$SnapshotId ---' cd /srv/classnotify-audit/snapshot/$SnapshotId sha256sum P1_RC1_BUILD_MANIFEST.json ClassNotifySetup.exe ClassNotify.Service.exe ClassNotify.Client.exe ClassNotify.Server-linux-arm64.tar.gz ClassNotify.Web-assets.zip "@ ssh -o BatchMode=yes -o ConnectTimeout=30 -i $SshKey -o StrictHostKeyChecking=no "root@${VpsHost}" $remoteVerifyCmd if ($LASTEXITCODE -ne 0) { throw "Remote validation failed" } Write-Host "`n==========================================================" -ForegroundColor Green Write-Host " RC1 Artifacts & Manifest successfully published! " -ForegroundColor Green Write-Host "==========================================================" -ForegroundColor Green