foms_app/build.sh
yumoqing 594f02a49d feat: foms_app 纯伞(应用壳)— 组装与启动,无业务逻辑
业务全部在独立模块仓库(foms / dbbackup / filesync / hostwatch),
本仓只做:入口组装、build、conf、start/stop、首页、RBAC 权限注册。

内容:
  · app/foms.py        入口,按序 load 全部模块
  · app/global_func.py get_module_dbname(统一库 foms)
  · build.sh           clone+安装全部模块、生成 DDL/CRUD、挂载 wwwroot
  · conf/config.json   website.paths:foms 根路径 + 三模块前缀
  · init/data.yaml     全部 codes(含拆分后新增的 codes)
  · scripts/load_path.py  重写为新 URL 布局
  · wwwroot/index.ui   首页(指向各模块前缀路径)

从 foms 仓库迁出的应用层文件(app/build/conf/start/stop/index.ui/data.yaml/
init_rbac/load_path)在 foms 侧已删除。
2026-08-27 11:08:38 +08:00

63 lines
1.9 KiB
Bash
Executable File
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/usr/bin/env bash
# foms_app 纯伞构建脚本 —— 只组装,无业务逻辑
# 业务全部在独立模块仓库foms / dbbackup / filesync / hostwatch
set -e
cdir=$(pwd)
echo "=== FOMS_APP Build纯伞==="
# 1. Create venv
[ ! -d py3 ] && python3 -m venv py3
source py3/bin/activate
# 2. Install foundation packages
mkdir -p pkgs
for m in apppublic sqlor ahserver bricks-for-python xls2ddl; do
cd $cdir/pkgs
[ ! -d "$m" ] && git clone https://git.opencomputing.cn/yumoqing/$m
cd $m && $cdir/py3/bin/pip install -e .
done
# 3. Build bricks frontend
cd $cdir/pkgs
[ ! -d "bricks" ] && git clone https://git.opencomputing.cn/yumoqing/bricks
cd bricks/bricks && ./build.sh
ln -sf $cdir/pkgs/bricks/dist $cdir/bricks
# 4. Install auth modules
for m in appbase rbac; do
cd $cdir/pkgs
[ ! -d "$m" ] && git clone https://git.opencomputing.cn/yumoqing/$m
cd $m && $cdir/py3/bin/pip install -e .
done
# 5. Install 全部业务模块(各自独立仓库,含核心 foms
for m in foms dbbackup filesync hostwatch; do
cd $cdir/pkgs
[ ! -d "$m" ] && git clone https://git.opencomputing.cn/yumoqing/$m
cd $m && $cdir/py3/bin/pip install -e .
# 生成模块 DDL
if [ -d models ]; then
json2ddl mysql models/ > models/mysql.ddl.sql 2>/dev/null || echo " skip ddl($m)"
fi
done
# 6. Generate CRUD UIxls2ui 从各模块 json/ 生成到各模块 wwwroot/
for m in foms dbbackup filesync hostwatch; do
md=$cdir/pkgs/$m
if [ -d "$md/json" ]; then
cd "$md/json"
for f in *.json; do
echo " xls2ui $m $f"
xls2ui -m ../models -o ../wwwroot "$m" "$f" 2>/dev/null || echo " skipped"
done
fi
done
# 7. Create runtime dirs
# (模块 wwwroot 通过 conf/config.json 的 website.paths 直接挂载,
# foms 核心在根路径,三模块在 /dbbackup /filesync /hostwatch 前缀下)
cd $cdir
mkdir -p logs files
echo "=== FOMS_APP Build Complete ==="