feat(deploy): compose up 后自动 promotion-import(YH_IMPORT_PROMOTION_SITE_ID + Docker go run)

Made-with: Cursor
This commit is contained in:
whm
2026-03-21 21:28:56 +08:00
parent c1fb5f3440
commit f4e51165a7
6 changed files with 89 additions and 2 deletions

View File

@@ -1,6 +1,7 @@
#!/usr/bin/env bash
# 将 web/promotion/视频发布 导入到 data/uploads + MongoDB site_assets无需后台手动上传
# 依赖:server/.env 中 MONGODB_URI、MONGODB_DB与 API 一致);本机可连 Mongo
# 部署时若已在 server/.env 设置 YH_IMPORT_PROMOTION_SITE_IDpull-and-restart/restart 会在 compose up 后自动执行等效逻辑Docker 内 go run见 run-promotion-import-on-deploy.sh
# 本脚本:在宿主机直接 go run依赖 server/.env 中 MONGODB_URI 能连上 Mongo若 Mongo 仅在 compose 内网,请用自动导入或 docker 网络)
#
# 用法:
# ./scripts/import-promotion-to-api.sh -site=你的站点MongoID