fix: connect Page Data sandbox to user PostgreSQL
Memind CI / Test, build, and release guards (pull_request) Failing after 15m29s
Memind CI / Test, build, and release guards (pull_request) Failing after 15m29s
This commit is contained in:
@@ -203,6 +203,7 @@ set -euo pipefail
|
||||
missing=0
|
||||
|
||||
pg_isready_bin="/opt/homebrew/opt/postgresql@17/bin/pg_isready"
|
||||
psql_bin="/opt/homebrew/opt/postgresql@17/bin/psql"
|
||||
if [[ -x "${pg_isready_bin}" ]]; then
|
||||
if ! "${pg_isready_bin}" -h 127.0.0.1 -p 5432 -q 2>/dev/null; then
|
||||
echo "goosed dependency check failed: host PostgreSQL (127.0.0.1:5432) is not accepting connections" >&2
|
||||
@@ -213,6 +214,19 @@ else
|
||||
echo "goosed dependency check warning: pg_isready not found; skipping PostgreSQL readiness check" >&2
|
||||
fi
|
||||
|
||||
portal_env="/Users/john/Project/Memind/.env"
|
||||
userdata_pg_url=""
|
||||
if [[ -f "${portal_env}" ]]; then
|
||||
userdata_pg_url="$(grep -E '^MINDSPACE_USERDATA_PG_URL=' "${portal_env}" | tail -1 | cut -d= -f2- || true)"
|
||||
fi
|
||||
if [[ -z "${userdata_pg_url}" ]]; then
|
||||
echo "goosed dependency check failed: Portal .env must set MINDSPACE_USERDATA_PG_URL" >&2
|
||||
missing=1
|
||||
elif [[ -x "${psql_bin}" ]] && ! "${psql_bin}" "${userdata_pg_url}" -Atc 'SELECT 1' >/dev/null 2>&1; then
|
||||
echo "goosed dependency check failed: user-space PostgreSQL URL cannot execute SELECT 1" >&2
|
||||
missing=1
|
||||
fi
|
||||
|
||||
docker_bin="/opt/homebrew/bin/docker"
|
||||
goosed_containers=()
|
||||
goosed_indexes=()
|
||||
@@ -240,6 +254,17 @@ if ((${#goosed_containers[@]} > 0)); then
|
||||
echo "goosed dependency check failed: ${container} missing /usr/local/bin/node or /opt/portal/mindspace-sandbox-mcp.mjs" >&2
|
||||
missing=1
|
||||
fi
|
||||
if ! "${docker_bin}" exec "${container}" /usr/local/bin/node -e '
|
||||
const net = require("net");
|
||||
const socket = net.connect({ host: "host.docker.internal", port: 5433 });
|
||||
const fail = () => process.exit(1);
|
||||
socket.setTimeout(3000, fail);
|
||||
socket.once("error", fail);
|
||||
socket.once("connect", () => { socket.end(); process.exit(0); });
|
||||
' >/dev/null 2>&1; then
|
||||
echo "goosed dependency check failed: ${container} cannot reach user-space PostgreSQL at host.docker.internal:5433" >&2
|
||||
missing=1
|
||||
fi
|
||||
done
|
||||
if [[ -f /Users/john/Project/Memind/.env ]]; then
|
||||
portal_mcp_node="$(grep -E '^GOOSED_MCP_NODE_PATH=' /Users/john/Project/Memind/.env | tail -1 | cut -d= -f2- || true)"
|
||||
|
||||
Reference in New Issue
Block a user