新增
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
$ErrorActionPreference = "Stop"
|
||||
|
||||
$projectRoot = Split-Path -Parent $PSScriptRoot
|
||||
$templateRoot = Join-Path $PSScriptRoot "baota_bundle"
|
||||
$packageStage = Join-Path $PSScriptRoot ".baota-package-stage"
|
||||
$packageFile = Join-Path $PSScriptRoot "wechat-backend-baota.zip"
|
||||
$expectedStage = [System.IO.Path]::GetFullPath(
|
||||
(Join-Path $projectRoot "backend_deploy\.baota-package-stage")
|
||||
)
|
||||
|
||||
if ([System.IO.Path]::GetFullPath($packageStage) -ne $expectedStage) {
|
||||
throw "临时目录校验失败"
|
||||
}
|
||||
|
||||
if (Test-Path -LiteralPath $packageStage) {
|
||||
Remove-Item -LiteralPath $packageStage -Recurse -Force
|
||||
}
|
||||
|
||||
try {
|
||||
New-Item -ItemType Directory -Path $packageStage | Out-Null
|
||||
Copy-Item -LiteralPath (Join-Path $projectRoot "admin_backend.py") -Destination $packageStage
|
||||
Copy-Item -LiteralPath (Join-Path $templateRoot "Dockerfile") -Destination $packageStage
|
||||
Copy-Item -LiteralPath (Join-Path $templateRoot "compose.yaml") -Destination $packageStage
|
||||
Copy-Item -LiteralPath (Join-Path $templateRoot ".env.example") -Destination $packageStage
|
||||
Copy-Item -LiteralPath (Join-Path $templateRoot "README.md") -Destination $packageStage
|
||||
Compress-Archive -Path (Join-Path $packageStage "*") -DestinationPath $packageFile -Force
|
||||
Write-Output "已生成:$packageFile"
|
||||
}
|
||||
finally {
|
||||
if (Test-Path -LiteralPath $packageStage) {
|
||||
Remove-Item -LiteralPath $packageStage -Recurse -Force
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user