Files
starRiverProperty/docs/testing/run_visitor_invite_page_one_click.sh
T
反编译工作区 25db029859 feat: 租户访客策略 SQL、访客邀约验证包、component-org 与发布脚本
- docs/sql: organization_* 与 tenant_* 访客楼层策略脚本
- docs/testing: 访客邀约页初始化验证、pack 脚本与 README(忽略 dist/__pycache__)
- maven-ninca-common-component-organization: CpImageStoreServiceImpl、starter、run-verify、releases 脚本与 javap 审计 JSON
- docs/superpowers: component-org 生产问题修复计划
- scripts/test-env/prepare-db.sh 更新

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-06 22:00:16 +08:00

42 lines
1.3 KiB
Bash
Executable File

#!/usr/bin/env bash
# 一键:访客邀约页初始化测试(默认 DB 样本 + 输出 JSON)
set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
# 仓库内:docs/testing → ../../scripts/...;独立部署包解压后无此文件则仅用下方默认环境变量
for _env in \
"${SCRIPT_DIR}/../../scripts/test-env/config/env.sh" \
"${SCRIPT_DIR}/../../../scripts/test-env/config/env.sh" \
"${SCRIPT_DIR}/../../../../scripts/test-env/config/env.sh"; do
if [[ -f "$_env" ]]; then
# shellcheck disable=SC1091
source "$_env"
break
fi
done
: "${PORT_COMPONENT_ORG:=33011}"
: "${MYSQL_HOST:=127.0.0.1}"
: "${MYSQL_PORT:=3307}"
: "${MYSQL_USER:=root}"
: "${MYSQL_PASS:=}"
# 组织组件 HTTP 与 MySQL 主机未必相同;默认本机 PORT_COMPONENT_ORG
export ORG_BASE="${ORG_BASE:-http://127.0.0.1:${PORT_COMPONENT_ORG}}"
export MYSQL_HOST MYSQL_PORT MYSQL_USER MYSQL_PASS
export DB_COMPONENT_ORG="${DB_COMPONENT_ORG:-component-organization}"
export DB_ELEVATOR="${DB_ELEVATOR:-cw-elevator-application}"
PY="${SCRIPT_DIR}/visitor_invite_page_init_example.py"
if [[ ! -f "$PY" ]]; then
echo "缺少脚本: $PY" >&2
exit 1
fi
python3 - <<'PYCHK' || { python3 -m pip install -q requests pymysql; }
import requests
import pymysql
PYCHK
echo "ORG_BASE=$ORG_BASE MYSQL=${MYSQL_HOST}:${MYSQL_PORT}" >&2
exec python3 "$PY" "$@"