目前,我目前在Plesk 17.5中的一个非常基本的NodeJS服务器上设置了自动Git部署 .
问题是如果我推送新提交,我需要手动登录Plesk仪表板并单击“重新启动应用程序”,否则更改不会生效 .
我尝试添加 npm start 作为Git部署的后命令之一,但这似乎不起作用 .
npm start
有没有人知道每次从Git自动部署时我如何自动重启我的节点应用程序?如果我必须登录并重新启动应用程序,它不是非常自动化......
您需要更新文件 tmp/restart.txt 的修改日期 .
tmp/restart.txt
touch tmp/restart.txt 的示例
touch tmp/restart.txt
使用Passenger,您还可以执行以下命令: passenger-config restart-app /Users/phusion/testapp . 但是我不和Plesk合作
passenger-config restart-app /Users/phusion/testapp
编辑:
Plesk use Phusion Passenger处理Node.js应用程序 .
要使用该命令,您需要存储库设置,"Enable additional deploy actions"需要"Actions" . 示例: (PATH=/opt/plesk/node/v9.8.0/bin:$PATH; npm install && npm run build &> npm-install.log) && touch tmp/restart.txt
(PATH=/opt/plesk/node/v9.8.0/bin:$PATH; npm install && npm run build &> npm-install.log) && touch tmp/restart.txt
试试 /etc/init.d/psa restart .
/etc/init.d/psa restart
我没有测试过 .
Source
Relevant page in official docs
2 回答
您需要更新文件
tmp/restart.txt
的修改日期 .touch tmp/restart.txt
的示例使用Passenger,您还可以执行以下命令:
passenger-config restart-app /Users/phusion/testapp
. 但是我不和Plesk合作编辑:
Plesk use Phusion Passenger处理Node.js应用程序 .
要使用该命令,您需要存储库设置,"Enable additional deploy actions"需要"Actions" . 示例:
(PATH=/opt/plesk/node/v9.8.0/bin:$PATH; npm install && npm run build &> npm-install.log) && touch tmp/restart.txt
试试
/etc/init.d/psa restart
.我没有测试过 .
Source
Relevant page in official docs