[crawler_platform 삭제]
This commit is contained in:
@@ -75,7 +75,7 @@ function Stop-ExistingServers {
|
||||
|
||||
$currentPid = $PID
|
||||
$rootPattern = [regex]::Escape($root)
|
||||
$commandPattern = "uvicorn|crawler_platform\.app\.main|ont_platform\.api|phase[0-9]_app|vite|npm(\.cmd)?\s+run\s+(dev|preview|start)"
|
||||
$commandPattern = "uvicorn|ont_platform\.api|phase[0-9]_app|vite|npm(\.cmd)?\s+run\s+(dev|preview|start)"
|
||||
|
||||
$matched = Get-CimInstance Win32_Process | Where-Object {
|
||||
if (-not $_.CommandLine) {
|
||||
@@ -87,7 +87,7 @@ function Stop-ExistingServers {
|
||||
$cmd = $_.CommandLine
|
||||
return ($cmd -match $commandPattern) -and (
|
||||
$cmd -match $rootPattern -or
|
||||
$cmd -match "crawler_platform|ontology_platform|ont_platform"
|
||||
$cmd -match "ontology_platform|ont_platform"
|
||||
)
|
||||
}
|
||||
|
||||
@@ -234,38 +234,20 @@ Stop-ExistingServers
|
||||
Start-Neo4jIfAvailable
|
||||
|
||||
$npm = Get-CommandPath @("npm.cmd", "npm")
|
||||
$frontendDir = Join-Path $root "crawler_platform\app\web\frontend"
|
||||
$frontendDir = Join-Path $root "ontology_platform\web\frontend"
|
||||
$frontendReady = $false
|
||||
if ((Test-Path -LiteralPath (Join-Path $frontendDir "package.json")) -and $npm) {
|
||||
if (-not (Test-Path -LiteralPath (Join-Path $frontendDir "node_modules"))) {
|
||||
Invoke-LoggedCommand -FilePath $npm -Arguments @("ci") -WorkingDirectory $frontendDir -LogName "frontend-npm-ci.log"
|
||||
}
|
||||
Invoke-LoggedCommand -FilePath $npm -Arguments @("run", "build") -WorkingDirectory $frontendDir -LogName "frontend-build.log"
|
||||
$frontendReady = $true
|
||||
} elseif (Test-Path -LiteralPath (Join-Path $frontendDir "package.json")) {
|
||||
Write-Step "npm was not found; skipping frontend rebuild."
|
||||
}
|
||||
|
||||
$servers = @()
|
||||
|
||||
$crawlerPython = Get-CommandPath @(
|
||||
(Join-Path $root ".venv\Scripts\python.exe"),
|
||||
(Join-Path $root "venv\Scripts\python.exe"),
|
||||
"C:\Users\lasta\AppData\Local\Python\bin\python.exe",
|
||||
"C:\Users\lasta\.cache\codex-runtimes\codex-primary-runtime\dependencies\python\python.exe",
|
||||
"python"
|
||||
)
|
||||
|
||||
if ((Test-Path -LiteralPath (Join-Path $root "crawler_platform\app\main.py")) -and $crawlerPython) {
|
||||
$servers += Start-LoggedServer `
|
||||
-Name "crawler-platform-8000" `
|
||||
-Port 8000 `
|
||||
-FilePath $crawlerPython `
|
||||
-Arguments @("-m", "uvicorn", "crawler_platform.app.main:app", "--host", "127.0.0.1", "--port", "8000") `
|
||||
-WorkingDirectory $root `
|
||||
-Environment @{ CRAWLER_DATABASE_URL = "sqlite:///crawler_platform.db" }
|
||||
} else {
|
||||
Write-Step "crawler_platform server entrypoint or Python was not found; skipped."
|
||||
}
|
||||
|
||||
$ontologyRoot = Join-Path $root "ontology_platform"
|
||||
$ontologyPython = Get-CommandPath @(
|
||||
(Join-Path $ontologyRoot ".venv\Scripts\python.exe"),
|
||||
@@ -292,6 +274,15 @@ if ((Test-Path -LiteralPath (Join-Path $ontologyRoot "ont_platform\api\main.py")
|
||||
Write-Step "ontology_platform server entrypoint or Python was not found; skipped."
|
||||
}
|
||||
|
||||
if ($frontendReady) {
|
||||
$servers += Start-LoggedServer `
|
||||
-Name "ontology-frontend-8000" `
|
||||
-Port 8000 `
|
||||
-FilePath $npm `
|
||||
-Arguments @("run", "dev", "--", "--host", "127.0.0.1", "--port", "8000") `
|
||||
-WorkingDirectory $frontendDir
|
||||
}
|
||||
|
||||
$pidFile = Join-Path $logDir "server-pids.txt"
|
||||
$servers | ForEach-Object {
|
||||
"{0} pid={1} stdout={2} stderr={3}" -f $_.Name, $_.Pid, $_.Stdout, $_.Stderr
|
||||
@@ -313,7 +304,6 @@ if ($missingPorts.Count -gt 0) {
|
||||
|
||||
Write-Host ""
|
||||
Write-Step "Done."
|
||||
Write-Host " Crawler UI/API: http://127.0.0.1:8000/static/"
|
||||
Write-Host " Crawler crawl page: http://127.0.0.1:8000/static/crawl/PerfumeSubscribe_new"
|
||||
Write-Host " Ontology UI: http://127.0.0.1:8000/static/"
|
||||
Write-Host " Ontology API: http://127.0.0.1:8001/docs"
|
||||
Write-Host " Logs: $logDir"
|
||||
|
||||
Reference in New Issue
Block a user