- 实现业务确认单条目的移出和恢复功能 - 添加报价匹配明细中的跳过处理选项 - 重构移动应用的环境配置使用默认开发配置 - 更新移动应用Android版本号策略 - 替换到货操作组件为独立的操作组件 - 添加安装配置检查脚本 - 增强测试覆盖包括条目移出恢复和报价跳过场景
25 lines
1.8 KiB
PowerShell
25 lines
1.8 KiB
PowerShell
param([string]$OutputDirectory = '', [string]$UpdateOrigin = '')
|
|
$ErrorActionPreference = 'Stop'
|
|
$taskApp = Split-Path $PSScriptRoot -Parent
|
|
$taskRepo = Split-Path $taskApp -Parent
|
|
if (!$OutputDirectory) { $OutputDirectory = Join-Path $taskRepo '.codex-tmp/app-dev-ota/data' }
|
|
if (!$UpdateOrigin) { $UpdateOrigin = (Get-Content -LiteralPath (Join-Path $taskApp 'config/development.json') -Encoding UTF8 -Raw | ConvertFrom-Json).updateOrigin }
|
|
try {
|
|
$env:APP_ENV = 'dev'
|
|
$env:APP_UPDATE_ORIGIN = $UpdateOrigin
|
|
$env:OTA_PRIVATE_KEY = Join-Path $taskApp 'keys/development/ota-private-key.pem'
|
|
$env:OTA_CERTIFICATE = Join-Path $taskApp 'certs/dev.pem'
|
|
$env:OTA_DATA_DIR = $OutputDirectory
|
|
$taskRuntime = (Get-Content -LiteralPath (Join-Path $taskApp 'dist/runtime-version.txt') -Raw).Trim()
|
|
$taskApkRuntime = (Get-Content -LiteralPath (Join-Path $taskApp 'android/app/build/generated/assets/createReleaseUpdatesResources/fingerprint') -Raw).Trim()
|
|
if ($taskRuntime -ne $taskApkRuntime) { throw 'Export fingerprint differs from built APK; rebuild before staging' }
|
|
$taskExportConfig = Get-Content -LiteralPath (Join-Path $taskApp 'dist/resolved-config.json') -Encoding UTF8 -Raw | ConvertFrom-Json
|
|
if ($taskExportConfig.extra.environment -ne 'dev' -or $taskExportConfig.updates.url -ne ($UpdateOrigin.TrimEnd('/') + '/updates/dev')) {
|
|
throw 'Exported App update URL differs from the development feed; export with matching development config first'
|
|
}
|
|
& node.exe (Join-Path $PSScriptRoot 'publish-update.mjs') (Join-Path $taskApp 'dist') (Join-Path $taskApp 'dist/resolved-config.json') $taskRuntime
|
|
if ($LASTEXITCODE) { throw 'Local signed development update staging failed' }
|
|
} finally {
|
|
foreach ($taskName in @('OTA_PRIVATE_KEY','OTA_CERTIFICATE')) { Remove-Item -LiteralPath "Env:$taskName" -ErrorAction SilentlyContinue }
|
|
}
|