# PixieSprout Expo preview — ONE-SHOT pipeline. # 1. Sync local source -> German server # 2. Build release APK on German server # 3. Publish APK to file server + create public share link # 4. Print the preview URL for Dana's wife # # Usage: powershell -File preview.ps1 $ErrorActionPreference = "Stop" $local = "C:\Users\danam\SGT-FANTASTIC-08-06-26\Local\PixieSprout" $remote = "root@46.4.121.190" $expoSystem = Join-Path $local "expo-system" # 1. Sync Write-Host "=== [1/3] Syncing source to German server ===" & (Join-Path $expoSystem "sync-to-german.ps1") if ($LASTEXITCODE -ne 0) { Write-Error "Sync failed"; exit 1 } # 2+3. Build + publish + share Write-Host "=== [2/3] Building + publishing on German server (2-3 min) ===" $output = ssh -o BatchMode=yes $remote "cd /root/sgt_code_workspace/PixieSprout && bash expo-system/build-and-publish.sh" 2>&1 $exit = $LASTEXITCODE $output | ForEach-Object { Write-Host $_ } if ($exit -ne 0) { Write-Error "Build/publish failed (exit $exit)"; exit 1 } # 4. Extract the share URL $urlLine = $output | Select-String -Pattern "https://files\.46-4-121-190\.sslip\.io/s/\S+" | Select-Object -Last 1 if ($urlLine) { $url = $urlLine.Matches[0].Value Write-Host "" Write-Host "=== [3/3] PREVIEW READY ===" Write-Host "Send this link to Dana's wife:" Write-Host " $url" Write-Host "(share expires in 7 days; re-run preview.ps1 for a fresh link)" } else { Write-Warning "Build/publish completed but no share URL was found in the output." }