Files
web/scripts/import-promotion-to-api.sh

14 lines
902 B
Bash
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
# 将 web/promotion/视频发布 导入到 data/uploads + MongoDB site_assets无需后台手动上传
# 部署时若已在 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
# ./scripts/import-promotion-to-api.sh -site=xxx -src=/www/yh_web/web/promotion/视频发布 -upload=/www/yh_web/data/uploads
# ./scripts/import-promotion-to-api.sh -site=xxx -dry-run
set -euo pipefail
ROOT="$(cd "$(dirname "$0")/.." && pwd)"
cd "$ROOT/server"
exec go run -mod=vendor ./cmd/promotion-import/ "$@"