Add dedicated self-contained publish helpers
Add backend and client self-contained publish scripts that clean the public output folders and publish Release win-x64 builds with the .NET runtime included for easier deployment.feature/centralized-offline-canteen
parent
688ef2afd3
commit
2792a02460
|
|
@ -0,0 +1,20 @@
|
|||
$ErrorActionPreference = "Stop"
|
||||
|
||||
$ProjectPath = ".\UtopiaCanteen.BackendService\UtopiaCanteen.BackendService.csproj"
|
||||
$OutputPath = "C:\Users\Public\UtopiaCanteenBackend"
|
||||
|
||||
Write-Host "Cleaning old backend publish folder..."
|
||||
if (Test-Path $OutputPath) {
|
||||
Remove-Item $OutputPath -Recurse -Force
|
||||
}
|
||||
|
||||
Write-Host "Publishing backend as self-contained..."
|
||||
dotnet publish $ProjectPath `
|
||||
-c Release `
|
||||
-r win-x64 `
|
||||
--self-contained true `
|
||||
-p:PublishSingleFile=false `
|
||||
-o $OutputPath
|
||||
|
||||
Write-Host "Backend self-contained publish completed:"
|
||||
Write-Host $OutputPath
|
||||
|
|
@ -0,0 +1,20 @@
|
|||
$ErrorActionPreference = "Stop"
|
||||
|
||||
$ProjectPath = ".\UtopiaCanteen.Client\UtopiaCanteen.Client.csproj"
|
||||
$OutputPath = "C:\Users\Public\UtopiaCanteenClient"
|
||||
|
||||
Write-Host "Cleaning old client publish folder..."
|
||||
if (Test-Path $OutputPath) {
|
||||
Remove-Item $OutputPath -Recurse -Force
|
||||
}
|
||||
|
||||
Write-Host "Publishing client as self-contained..."
|
||||
dotnet publish $ProjectPath `
|
||||
-c Release `
|
||||
-r win-x64 `
|
||||
--self-contained true `
|
||||
-p:PublishSingleFile=false `
|
||||
-o $OutputPath
|
||||
|
||||
Write-Host "Client self-contained publish completed:"
|
||||
Write-Host $OutputPath
|
||||
Loading…
Reference in New Issue