基本上我想:
git --work-tree=/home/aero/server --git-dir=/home/aero/server/.git pull; ps aux | grep node | grep server-aero-static | awk '{print $2}' | xargs kill -9; cd /home/aero/server; npm start;
我不认为这会在邮政接收工作,为什么?我怎么才能让它工作呢?
如果远程“origin”在 /home/aero/server ,以便回购协议正常工作(如“ Git post-receive not working correctly
/home/aero/server
post-receive
这个 npm start 如果该命令被阻止,则部分可能会出现问题。 using pm2 启动应用程序,如“中所述” A Friendly Guide To Automate Deployment For Node.js Apps With Git Hooks aunnnn
npm start
pm2
pm2 start npm --name 'my-app' â start \ && echo "post-receive: app started successfully with pm2".