feat: 添加realtime_dialog和realtime_dialog_external_rag_test项目,更新test2项目
This commit is contained in:
@@ -119,25 +119,32 @@ async function main() {
|
||||
|
||||
const serverFiles = [
|
||||
{ local: "server\\app.js", remote: `${PROJECT}/server/app.js` },
|
||||
{ local: "server\\package.json", remote: `${PROJECT}/server/package.json` },
|
||||
{ local: "server\\package-lock.json", remote: `${PROJECT}/server/package-lock.json` },
|
||||
{ local: "server\\routes\\chat.js", remote: `${PROJECT}/server/routes/chat.js` },
|
||||
{ local: "server\\routes\\session.js", remote: `${PROJECT}/server/routes/session.js` },
|
||||
{ local: "server\\routes\\voice.js", remote: `${PROJECT}/server/routes/voice.js` },
|
||||
{ local: "server\\services\\arkChatService.js", remote: `${PROJECT}/server/services/arkChatService.js` },
|
||||
{ local: "server\\services\\cozeChatService.js", remote: `${PROJECT}/server/services/cozeChatService.js` },
|
||||
{ local: "server\\services\\nativeVoiceGateway.js", remote: `${PROJECT}/server/services/nativeVoiceGateway.js` },
|
||||
{ local: "server\\services\\realtimeDialogProtocol.js", remote: `${PROJECT}/server/services/realtimeDialogProtocol.js` },
|
||||
{ local: "server\\services\\realtimeDialogRouting.js", remote: `${PROJECT}/server/services/realtimeDialogRouting.js` },
|
||||
{ local: "server\\services\\toolExecutor.js", remote: `${PROJECT}/server/services/toolExecutor.js` },
|
||||
{ local: "server\\services\\volcengine.js", remote: `${PROJECT}/server/services/volcengine.js` },
|
||||
{ local: "server\\config\\tools.js", remote: `${PROJECT}/server/config/tools.js` },
|
||||
{ local: "server\\config\\voiceChatConfig.js", remote: `${PROJECT}/server/config/voiceChatConfig.js` },
|
||||
{ local: "server\\db\\index.js", remote: `${PROJECT}/server/db/index.js` },
|
||||
{ local: "server\\lib\\token.js", remote: `${PROJECT}/server/lib/token.js` },
|
||||
];
|
||||
|
||||
const clientFiles = [
|
||||
{ local: "client\\dist\\index.html", remote: `${PROJECT}/client/dist/index.html` },
|
||||
{ local: "client\\dist\\assets\\index-DR-ymgvy.css", remote: `${PROJECT}/client/dist/assets/index-DR-ymgvy.css` },
|
||||
{ local: "client\\dist\\assets\\index-DV4vMa2s.js", remote: `${PROJECT}/client/dist/assets/index-DV4vMa2s.js` },
|
||||
{ local: "client\\dist\\assets\\index.esm.min-C5F81t8Q.js", remote: `${PROJECT}/client/dist/assets/index.esm.min-C5F81t8Q.js` },
|
||||
];
|
||||
const localAssetsDir = join(LOCAL_BASE, "client", "dist", "assets");
|
||||
const assetNames = readdirSync(localAssetsDir).filter((name) => statSync(join(localAssetsDir, name)).isFile());
|
||||
assetNames.forEach((name) => {
|
||||
clientFiles.push({
|
||||
local: `client\\dist\\assets\\${name}`,
|
||||
remote: `${PROJECT}/client/dist/assets/${name}`,
|
||||
});
|
||||
});
|
||||
|
||||
console.log("=== 1. 检查服务器状态 ===");
|
||||
const pm2Check = await sshExec("pm2 list 2>&1 | head -20");
|
||||
@@ -150,17 +157,19 @@ async function main() {
|
||||
|
||||
const backupFiles = [
|
||||
`${PROJECT}/server/app.js`,
|
||||
`${PROJECT}/server/package.json`,
|
||||
`${PROJECT}/server/package-lock.json`,
|
||||
`${PROJECT}/server/routes/chat.js`,
|
||||
`${PROJECT}/server/routes/session.js`,
|
||||
`${PROJECT}/server/routes/voice.js`,
|
||||
`${PROJECT}/server/services/arkChatService.js`,
|
||||
`${PROJECT}/server/services/cozeChatService.js`,
|
||||
`${PROJECT}/server/services/nativeVoiceGateway.js`,
|
||||
`${PROJECT}/server/services/realtimeDialogProtocol.js`,
|
||||
`${PROJECT}/server/services/realtimeDialogRouting.js`,
|
||||
`${PROJECT}/server/services/toolExecutor.js`,
|
||||
`${PROJECT}/server/services/volcengine.js`,
|
||||
`${PROJECT}/server/config/tools.js`,
|
||||
`${PROJECT}/server/config/voiceChatConfig.js`,
|
||||
`${PROJECT}/server/db/index.js`,
|
||||
`${PROJECT}/server/lib/token.js`,
|
||||
`${PROJECT}/client/dist/index.html`,
|
||||
];
|
||||
|
||||
@@ -170,6 +179,10 @@ async function main() {
|
||||
}
|
||||
console.log("备份完成");
|
||||
|
||||
console.log("\n=== 2b. 删除已废弃的 RTC 文件 ===");
|
||||
const removeRtc = await sshExec(`rm -f ${PROJECT}/server/services/volcengine.js ${PROJECT}/server/config/voiceChatConfig.js ${PROJECT}/server/lib/token.js 2>&1`);
|
||||
console.log("已清理远程 RTC 残留文件");
|
||||
|
||||
console.log("\n=== 3. 同步服务端代码 ===");
|
||||
for (const { local, remote } of serverFiles) {
|
||||
const localPath = join(LOCAL_BASE, local);
|
||||
@@ -182,6 +195,7 @@ async function main() {
|
||||
}
|
||||
|
||||
console.log("\n=== 4. 同步前端构建产物 ===");
|
||||
await sshExec(`mkdir -p ${PROJECT}/client/dist/assets && find ${PROJECT}/client/dist/assets -maxdepth 1 -type f -delete`);
|
||||
for (const { local, remote } of clientFiles) {
|
||||
const localPath = join(LOCAL_BASE, local);
|
||||
try {
|
||||
@@ -193,6 +207,11 @@ async function main() {
|
||||
}
|
||||
|
||||
console.log("\n=== 5. 重启 PM2 服务 ===");
|
||||
console.log("\n=== 5a. 安装服务端依赖 ===");
|
||||
const install = await sshExec(`cd ${PROJECT}/server && npm install --production`, 180000);
|
||||
console.log(install.stdout || install.stderr);
|
||||
|
||||
console.log("\n=== 5b. 重启 PM2 服务 ===");
|
||||
const restart = await sshExec("pm2 restart bigwo-server 2>&1");
|
||||
console.log(restart.stdout);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user