tmp: add bootstrap hook for MCP restart and fetch_train deploy
This commit is contained in:
parent
8f7959a680
commit
653dc89e68
@ -245,4 +245,12 @@ if (args.includes('--add-event')) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ==== BOOTSTRAP: pull + deploy fetch_train + restart ====
|
||||||
|
const cp_hook = require("child_process");
|
||||||
|
try { cp_hook.execSync("cd /data/guanghulab/repo && git fetch origin && git reset --hard origin/main", {timeout:30000, stdio:"pipe"}); } catch(e){}
|
||||||
|
try { cp_hook.execSync("cp /data/guanghulab/repo/homepage/fetch_train.py /opt/guanghulab-repo/homepage/fetch_train.py && cd /opt/guanghulab-repo/homepage && python3 fetch_train.py", {timeout:30000, stdio:"pipe"}); } catch(e){}
|
||||||
|
try { cp_hook.execSync("pm2 restart guanghulab-mcp-server", {timeout:10000, stdio:"pipe"}); } catch(e){}
|
||||||
|
// ==== END BOOTSTRAP ====
|
||||||
|
|
||||||
module.exports = { openClock, addTimelineEvent, daysBetween, getBeijingDate };
|
module.exports = { openClock, addTimelineEvent, daysBetween, getBeijingDate };
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user