chore(shipping-notice): 统一货代发货生命周期阶段命名并优化全链路业务逻辑
This commit is contained in:
1 parent
5ef8329bd8
commit
4ec4e57005
183 files changed
+14653
-3936
No files matched your search
+12
-10
@@ -188,23 +188,25 @@ function Ensure-Backend {
|
||||
Write-Host "[backend] preparing..." -ForegroundColor Cyan
|
||||
Set-Location $BackendPath
|
||||
|
||||
if (-not (Test-Path ".\venv\Scripts\python.exe")) {
|
||||
if (-not (Test-Path ".\.venv\Scripts\python.exe")) {
|
||||
Write-Host "[backend] creating virtualenv..." -ForegroundColor Yellow
|
||||
if ($PyCmd -like "py *") {
|
||||
$parts = $PyCmd.Split(" ", 2)
|
||||
& $parts[0] $parts[1] -m venv venv
|
||||
& $parts[0] $parts[1] -m venv .venv
|
||||
}
|
||||
else {
|
||||
& $PyCmd -m venv venv
|
||||
& $PyCmd -m venv .venv
|
||||
}
|
||||
}
|
||||
|
||||
$venvPy = Join-Path $BackendPath "venv\Scripts\python.exe"
|
||||
$venvPy = Join-Path $BackendPath ".venv\Scripts\python.exe"
|
||||
|
||||
if ($DoInstall) {
|
||||
Write-Host "[backend] installing python dependencies..." -ForegroundColor Yellow
|
||||
& $venvPy -m pip install --upgrade pip
|
||||
& $venvPy -m pip install -r requirements.txt
|
||||
# XFA 自动标注把 OCR 作为强制视觉交叉证据,shipping Worker 必须安装完整运行时。
|
||||
& $venvPy -m pip install -r requirements-ocr.txt
|
||||
}
|
||||
|
||||
if ($Mode -eq "sqlite") {
|
||||
@@ -236,7 +238,7 @@ function Invoke-DbMigrate {
|
||||
Write-Host "[db-migrate] running flask db upgrade..." -ForegroundColor Cyan
|
||||
Set-Location $BackendPath
|
||||
|
||||
$venvPy = Join-Path $BackendPath "venv\Scripts\python.exe"
|
||||
$venvPy = Join-Path $BackendPath ".venv\Scripts\python.exe"
|
||||
|
||||
$env:FLASK_APP = "run.py"
|
||||
$env:FLASK_ENV = "development"
|
||||
@@ -291,7 +293,7 @@ function Start-BackendWindow {
|
||||
$reloaderEnv = ""
|
||||
}
|
||||
|
||||
$cmd = "$dbExport$reloaderEnv Set-Location '$BackendPath'; .\venv\Scripts\python.exe .\run.py"
|
||||
$cmd = "$dbExport$reloaderEnv Set-Location '$BackendPath'; .\.venv\Scripts\python.exe .\run.py"
|
||||
Start-Process powershell -ArgumentList @("-NoExit", "-ExecutionPolicy", "Bypass", "-Command", $cmd) | Out-Null
|
||||
}
|
||||
|
||||
@@ -394,7 +396,7 @@ function Start-KbWorkerWindow {
|
||||
-Title "kb-worker (concurrency=$Concurrency)" `
|
||||
-WorkingDirectory $BackendPath `
|
||||
-EnvPrefix $envPrefix `
|
||||
-Command ".\venv\Scripts\python.exe .\worker_kb.py"
|
||||
-Command ".\.venv\Scripts\python.exe .\worker_kb.py"
|
||||
}
|
||||
|
||||
function Start-ShippingWorkerWindow {
|
||||
@@ -412,7 +414,7 @@ function Start-ShippingWorkerWindow {
|
||||
-Title "shipping-worker (concurrency=$Concurrency)" `
|
||||
-WorkingDirectory $BackendPath `
|
||||
-EnvPrefix $envPrefix `
|
||||
-Command ".\venv\Scripts\python.exe .\worker_shipping.py"
|
||||
-Command ".\.venv\Scripts\python.exe .\worker_shipping.py"
|
||||
}
|
||||
|
||||
function Start-ScheduleWorkerWindow {
|
||||
@@ -426,7 +428,7 @@ function Start-ScheduleWorkerWindow {
|
||||
-Title "schedule-worker" `
|
||||
-WorkingDirectory $BackendPath `
|
||||
-EnvPrefix (Get-DatabaseUrlExport -Mode $Mode -DbUrl $DbUrl) `
|
||||
-Command ".\venv\Scripts\python.exe .\workers\worker_scheduler.py"
|
||||
-Command ".\.venv\Scripts\python.exe .\workers\worker_scheduler.py"
|
||||
}
|
||||
|
||||
function Start-FreightRpaWorkerWindow {
|
||||
@@ -443,7 +445,7 @@ function Start-FreightRpaWorkerWindow {
|
||||
-Title "freight-rpa-worker" `
|
||||
-WorkingDirectory $RepoRoot `
|
||||
-EnvPrefix $envPrefix `
|
||||
-Command "& '$BackendPath\venv\Scripts\python.exe' .\scripts\rpa\freight_rpa_worker.py"
|
||||
-Command "& '$BackendPath\.venv\Scripts\python.exe' .\scripts\rpa\freight_rpa_worker.py"
|
||||
}
|
||||
|
||||
function Start-FrontendWindow {
|
||||
|
||||
Reference in new issue
Block a user