Files
inquiry_robot/deploy/_remote_write_cutover_intent.ps1
T

29 lines
1.1 KiB
PowerShell

$ErrorActionPreference = "Stop"
$Root = "E:\wwwroot"
$ops = Join-Path $Root "ops"
New-Item -ItemType Directory -Force -Path $ops | Out-Null
$intent = @{
cutoverTarget = "replace-yutongda"
deployRoot = $Root
oldRoot = "C:\yutongda"
phase = "P0-isolation-until-ready"
decidedAt = "2026-09-12"
note = "YTD_ENV stays test until P1; do not connect jeecg-boot/ytd_runtime/ytd:prod:/ytd-inquiry"
checklist = "deploy/CUTOVER-TO-PROD.md"
} | ConvertTo-Json
Set-Content -Path (Join-Path $ops "cutover-intent.json") -Value $intent -Encoding UTF8
# annotate .env if present (idempotent)
$envFile = Join-Path $Root ".env"
if (Test-Path $envFile) {
$raw = Get-Content $envFile -Raw
if ($raw -notmatch "YTD_CUTOVER_TARGET=") {
Add-Content -Path $envFile -Value "`r`n# scheme B: replace C:\yutongda; see deploy/CUTOVER-TO-PROD.md`r`nYTD_CUTOVER_TARGET=replace-yutongda`r`nYTD_DEPLOY_ROOT=E:\wwwroot`r`n"
Write-Output "ENV_ANNOTATED"
} else {
Write-Output "ENV_ALREADY_ANNOTATED"
}
}
Get-Content (Join-Path $ops "cutover-intent.json")
Write-Output "INTENT_OK"