feat: 项目从deno迁移回使用bun

This commit is contained in:
ethan.chen
2026-01-08 14:30:11 +08:00
parent 2b5b2f1d97
commit 02ebb4c648
10 changed files with 101 additions and 152 deletions

View File

@@ -13,7 +13,7 @@ REMOTE_DIR="/home/media-backend"
# 本地构建
echo "Building project..."
deno cache main.ts
bun install
# 创建远程目录
echo "Creating remote directory..."
@@ -26,9 +26,10 @@ ssh $USER@$SERVER "cp $REMOTE_DIR/db/media.db $REMOTE_DIR/db/media.db.bak 2>/dev
# 2. 同步代码到服务器(只同步白名单内容,且排除 media.db
rsync -avz --exclude='.git/' --exclude='node_modules/' --exclude='db/media.db' \
--include='*.ts' --include='*.json' --include='*.sh' --include='*.service' \
--include='package.json' --include='package-lock.json' --include='bun.lockb' \
--include='db/' --include='db/*.ts' --include='routes/' --include='routes/*.ts' \
--exclude='*' ./ $USER@$SERVER:$REMOTE_DIR
# 在服务器上安装依赖并重启服务
echo "Installing and starting systemd service..."
ssh $USER@$SERVER "systemctl restart my-score"
echo "Installing dependencies and restarting service..."
ssh $USER@$SERVER "cd $REMOTE_DIR && bun install && systemctl restart my-score"