Files
ssw-ontology/build.sh
T
ssw f1b687c2d2 目录扁平化:子目录内容提升至仓库根,文档归入 docs/
- 将 shangshu-ontology/ 子目录内容移至仓库根一级
- 修复 run.sh 的 REPO_ROOT 计算(扁平化后不再需要 cd ..),ARCHIVE_DIR 正确指向仓库根/archive
- 文档(README/PLAN/USAGE/IMPORT/product-intro)移至 docs/,同步更新结构树与导入命令中的旧路径
- 新增根 README.md 索引指向 docs/
- 新增 .gitignore:忽略 bin/、web/node_modules/、web/dist/、server/webroot/、.env、.workbuddy/ 等噪音
- main.go 的 ARCHIVE_DIR fallback 基于可执行文件相邻上级,扁平化后仍正确,无需改动
2026-08-07 14:21:34 +08:00

27 lines
745 B
Bash
Executable File
Raw 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
# 尚数网本体管理平台 - 本地构建脚本
# 负责:前端构建 + 后端编译(产物为 bin/server,直接运行,无需 docker)
set -euo pipefail
cd "$(dirname "$0")"
echo "==> [1/3] 构建前端 (Vue -> web/dist)"
cd web
npm install
npm run build
cd ..
echo "==> [2/3] 同步前端产物到 server/webroot (Go embed)"
rm -rf server/webroot
cp -r web/dist server/webroot
echo "==> [3/3] 编译后端 (本机运行用)"
cd server
go build -o ../bin/server .
cd ..
echo ""
echo "构建完成 ✅"
echo " - 运行 : ./run.sh (默认连 workspace 内 Postgres localhost:15432/shangshu)"
echo " - 或 : DATABASE_URL='postgres://dacli:dacli123@localhost:15432/shangshu?sslmode=disable' ./bin/server"