fix(build): export venv/bin to PATH so json/build.sh can find xls2ui
This commit is contained in:
parent
8057ba2888
commit
604cffd897
6
build.sh
6
build.sh
@ -33,6 +33,7 @@ BUSINESS_MODULES="world scene entity script_engine world_snapshot world_sync"
|
||||
|
||||
APP_SRC_DIR="$(cd "$(dirname "$0")" && pwd)"
|
||||
mkdir -p "${DEPLOY_DIR}"
|
||||
export PATH="${VENV}/bin:${PATH}"
|
||||
|
||||
echo "==> [0/9] venv"
|
||||
if [ ! -x "${VENV}/bin/python" ]; then
|
||||
@ -102,13 +103,12 @@ PY
|
||||
echo "==> [6/9] per-module install: ① json2ddl建表 ② json/build.sh ③ wwwroot软链 ④ 数据导入"
|
||||
for m in ${BUSINESS_MODULES}; do
|
||||
echo " -- ${m}"
|
||||
# ① 建表:模块 models 是唯一事实源;去掉 DROP 行,重跑不丢数据
|
||||
# ① 建表:模块 models 是唯一事实源;json2ddl 输出 DROP+CREATE,每次部署权威重建
|
||||
(cd "pkgs/${m}/models" && "${VENV}/bin/json2ddl" mysql .) > "/tmp/${m}_ddl.sql" \
|
||||
|| { echo "ERROR: ${m} json2ddl failed" >&2; exit 1; }
|
||||
[ -s "/tmp/${m}_ddl.sql" ] || { echo "ERROR: ${m} DDL empty" >&2; exit 1; }
|
||||
grep -vi "^drop table" "/tmp/${m}_ddl.sql" > "/tmp/${m}_ddl_nodrop.sql"
|
||||
mysql -h "${DB_HOST}" -P "${DB_PORT}" -u "${DB_USER}" -p"${DB_PASSWORD}" "${DB_NAME}" \
|
||||
< "/tmp/${m}_ddl_nodrop.sql" || { echo "ERROR: ${m} create tables failed" >&2; exit 1; }
|
||||
< "/tmp/${m}_ddl.sql" || { echo "ERROR: ${m} create tables failed" >&2; exit 1; }
|
||||
# ② CRUD 页面(模块仓库自带 json/build.sh)
|
||||
(cd "pkgs/${m}/json" && bash build.sh) || { echo "ERROR: ${m} json/build.sh failed" >&2; exit 1; }
|
||||
# ③ wwwroot 软链(非 cp)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user