Open c0bra opened 7 years ago
Care that hooks are run with non-interactive shell so env var that are inside ~/.bashrc
or ~/.zshrc
arent loaded
The only environment variable used is NODE_ENV which is set in deploy.config.js.
Are you sure that pm2/node are available with the default env (eg. You didn't hardcoded the path with nvm for example) ? Have you any specific ssh config (ssh subsystem limitation) ?
Yes the post-deploy hook was working at one point. We're not using nvm.
I did notice that the script has no interpreter shebang. Could that be it? I can try adding it and see what happens.
Nope, bleh.
Any updates on this issue? I'm getting similar useless errors when post-deploy attempts to run.
Well I was deploying to our webserver as the apache user. The default login shell was specified as /bin/csh in the /etc/passwd file. I changed it to /usr/bash and now things are working. yay
@dsclassen I think in our case we were expecting the NODE_ENV set on the project to be available and it wasn't so we had to set it explicitly in the post-deploy hook.
Unfortunately there's no errors or any indication of what's going on. The post hook is a simple bash script that can be run manually as the same user pm2 is connecting with.
Any tips on how to debug?