Remote nodejs server deployment with forever

﹥>﹥吖頭↗ 提交于 2019-12-06 07:04:44
VonC

In this case, the environment variable was slightly different between a local call and a call through ssh.

The Op aa333 confirms in the comments:

Had to export NODE_PATH before running the rest of the script.

That allows for the node command forever to run through the ssh session.


More generally, for a hook, I always recommend:

Add before your git pull:

unset GIT_DIR

If you don't unset GIT_DIR, then, when executed in a hook, it will still operate as it was in the git repo where you push (and not the one where you change directory to).

See for instance:

As in the second link, I would, to be sure, do a:

git --git-dir=/home/app/personal_website/server/.git --work-tree=/home/app/personal_website/server pull --quiet

Or, since git 1.8.5:

git -C /home/app/personal_website/server pull --quiet
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!