lili 3ead87206a
Some checks failed
Backend Maven CI / backend-local (push) Has been cancelled
fix(deploy): 固定mini后端迁移目录
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-28 08:27:22 -07:00

46 lines
1.5 KiB
Bash
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
set -euo pipefail
# mini-desktop 只承载 Muse RC 进程,基础设施继续复用 mini-ubuntu-infra。
# 凭据文件只在运行时 source脚本本身绝不保存密码、Token 或 API Key。
ROOT="${MUSE_RC_ROOT:-/opt/muse-rc1}"
ENV_FILE="${MUSE_INFRA_ENV:-/root/.config/muse-repo/infra.env}"
AI_ENV_FILE="${MUSE_AI_ENV:-/root/.config/muse-repo/p1r-external-acceptance.env}"
if [[ -f "${ENV_FILE}" ]]; then
set -a
# shellcheck disable=SC1090
source "${ENV_FILE}"
set +a
fi
if [[ -f "${AI_ENV_FILE}" ]]; then
set -a
# shellcheck disable=SC1090
source "${AI_ENV_FILE}"
set +a
fi
# Redis 由本部署目录的 start-redis.sh 在 mini-desktop 本机拉起;这里保留 env 默认值。
export MUSE_POSTGRES_HOST="${MUSE_POSTGRES_HOST:-100.64.0.8}"
export MUSE_POSTGRES_PORT="${MUSE_POSTGRES_PORT:-5433}"
export MUSE_POSTGRES_DATABASE="${MUSE_POSTGRES_DATABASE:-muse_slice_live}"
export MUSE_POSTGRES_USERNAME="${MUSE_POSTGRES_USERNAME:-root}"
export MUSE_REDIS_HOST="${MUSE_REDIS_HOST:-127.0.0.1}"
export MUSE_REDIS_PORT="${MUSE_REDIS_PORT:-6379}"
# Flyway 配置包含 filesystem:sql/muse固定工作目录避免从 /root 等目录启动时漏扫部署内迁移。
cd "${ROOT}"
exec /usr/lib/jvm/java-21-openjdk-amd64/bin/java \
-Xms512m -Xmx2g \
-Dhttp.proxyHost= \
-Dhttps.proxyHost= \
-Djava.net.useSystemProxies=false \
-DsocksProxyHost= \
-DsocksProxyPort= \
-jar "${ROOT}/backend/muse-server.jar" \
--server.port=48081 \
--spring.profiles.active=local,infra \
--muse.codegen.import-enable=false