upd deploy
This commit is contained in:
parent
535f3aca38
commit
3214fd5364
|
|
@ -1 +1 @@
|
|||
1.2.4
|
||||
1.2.5
|
||||
|
|
@ -129,6 +129,13 @@ Write-Host "=== Restart App Service ===" -ForegroundColor Cyan
|
|||
az webapp restart --name $APP --resource-group $RG
|
||||
|
||||
Write-Host "=== Post-Deploy DB Validation ===" -ForegroundColor Cyan
|
||||
|
||||
$validationOk = $false
|
||||
$keepValidating = $true
|
||||
|
||||
while ($keepValidating) {
|
||||
$keepValidating = $false
|
||||
|
||||
Write-Host " Waiting for server to boot (~20s)..." -ForegroundColor DarkGray
|
||||
$bootDeadline = (Get-Date).AddSeconds(45)
|
||||
$serverReady = $false
|
||||
|
|
@ -143,7 +150,6 @@ if (-not $serverReady) {
|
|||
Write-Host " WARNING: Server did not respond within 45s" -ForegroundColor Red
|
||||
}
|
||||
|
||||
$validationOk = $false
|
||||
if ($serverReady -and $env:KA_NOTE_DEPLOY_API_KEY) {
|
||||
$authHeader = @{ Authorization = "Bearer $env:KA_NOTE_DEPLOY_API_KEY" }
|
||||
$maxRetries = 6
|
||||
|
|
@ -180,8 +186,11 @@ if (-not $validationOk) {
|
|||
Write-Host " !! DB appears empty or unreachable after deploy !!" -ForegroundColor Red
|
||||
Write-Host " Pre-deploy backup: $($latestBackup.FullName)" -ForegroundColor Yellow
|
||||
Write-Host ""
|
||||
$answer = Read-Host " Restore backup to prod? (yes/no)"
|
||||
if ($answer -eq 'yes') {
|
||||
$answer = Read-Host " Restore backup to prod? (yes/no/retry)"
|
||||
if ($answer -eq 'retry') {
|
||||
Write-Host " Retrying validation..." -ForegroundColor Cyan
|
||||
$keepValidating = $true
|
||||
} elseif ($answer -eq 'yes') {
|
||||
Write-Host " Uploading backup to prod..." -ForegroundColor Cyan
|
||||
Invoke-WebRequest -Uri $KuduDbUrl `
|
||||
-Method PUT `
|
||||
|
|
@ -195,6 +204,7 @@ if (-not $validationOk) {
|
|||
exit 1
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Write-Host "=== Done! $VERSION deployed ===" -ForegroundColor Green
|
||||
Write-Host "Check: https://$APP.azurewebsites.net"
|
||||
|
|
|
|||
Loading…
Reference in New Issue