23 lines
1.1 KiB
PowerShell
23 lines
1.1 KiB
PowerShell
# Confirm final smoke + .env hosts (no secrets).
|
|
$ErrorActionPreference = "Continue"
|
|
$mysql = "C:\yutongda\tools\mysql-8.0.39-winx64\bin\mysql.exe"
|
|
$psql = "C:\yutongda\tools\pgsql\bin\psql.exe"
|
|
$sec = Get-Content "E:\wwwroot\ops\inquiry_robot_db_secrets.json" -Raw | ConvertFrom-Json
|
|
$intranet = "10.206.0.15"
|
|
|
|
Write-Output "=== .env hosts ==="
|
|
Select-String -Path "E:\wwwroot\.env" -Pattern '^(MYSQL_HOST|PG_HOST|MYSQL_DB|PG_DATABASE|MYSQL_USER|PG_USER)=' | ForEach-Object { $_.Line }
|
|
|
|
$mp = [string]$sec.mysql_password
|
|
$out = & $mysql -h $intranet -P3306 -uinquiry_robot "-p$mp" --batch -N inquiry_robot -e "SELECT 'mysql_ok'" 2>&1
|
|
Write-Output ("mysql=" + (($out | ForEach-Object {"$_"}) -join " "))
|
|
|
|
$env:PGPASSWORD = [string]$sec.pg_password
|
|
$out2 = & $psql -h $intranet -p 5432 -U inquiry_robot_runtime -d inquiry_robot_runtime -tAc "SELECT 'pg_ok'" 2>&1
|
|
Write-Output ("pg=" + (($out2 | ForEach-Object {"$_"}) -join " "))
|
|
Remove-Item Env:PGPASSWORD -EA SilentlyContinue
|
|
|
|
Write-Output "=== status json ==="
|
|
Get-Content "E:\wwwroot\ops\data-plane-status.json" -Raw
|
|
Write-Output "CONFIRM_DONE"
|