I have a git repo on a remote server (my own). I want to make sure that after a git push
onto that remote server, a new instance of the node program is pulled in the local development server (then, forever
will pickup the changes and restart it).
At the moment, I have a hook doing this (post-receive
):
unset GIT_DIR
export PATH=$PATH:/usr/local/bin/
cd /home/www/node/deployed/node_modules/wonder-server
git pull
echo "POST COMMIT FINISHED"
However, it comes with problems:
- It expects modules to be installed, and in the right version, in the development machine
- We also maintain some of the npm modules which we also update at times
Is this a good way to go about this? Or, can you think of better ways?