Kill stale site processes and enable remote migrations by default in deploy script

This commit is contained in:
2026-02-05 00:37:47 +01:00
parent f4b21da24d
commit 19b49f24a3

View File

@@ -81,6 +81,8 @@ if ($RecycleAppPool) {
ScriptBlock = {
Import-Module WebAdministration
Stop-WebAppPool -Name $using:AppPoolName -ErrorAction SilentlyContinue
Get-Process GameList -ErrorAction SilentlyContinue | Stop-Process -Force -ErrorAction SilentlyContinue
Get-Process dotnet -ErrorAction SilentlyContinue | Where-Object { $_.Path -like "*picknplay*" } | Stop-Process -Force -ErrorAction SilentlyContinue
}
}
if ($UseWinRmHttps) { $invokeParams["UseSSL"] = $true }
@@ -138,10 +140,10 @@ if ($RunEfMigrations) {
ScriptBlock = {
param($sitePath)
Set-Location $sitePath
if (-not (Get-Command dotnet-ef -ErrorAction SilentlyContinue)) {
throw "dotnet-ef not available on remote host. Install SDK or set `$RunEfMigrations = $false."
if (-not (Get-Command dotnet ef -ErrorAction SilentlyContinue)) {
throw "dotnet ef not available on remote host. Install SDK or set `$RunEfMigrations = $false."
}
dotnet-ef database update --no-build
dotnet ef database update --no-build
}
ArgumentList = @($RemoteSitePath)
}