Open ghost opened 2 years ago
Hi there.
I was trying to deploy my project to a Debian server, which has dash configured as the default shell. I was running into weird errors like this:
dash
--> Deploying to production environment --> on host *** ○ deploying origin/master ○ executing pre-deploy-local ○ executing pre-deploy `node -v && npm -v` v16.13.0 8.1.0 sh: 1: Bad substitution pre-deploy hook failed Deploy failed Deploy failed with exit code: 1
After some digging, I conjecture that the deployment script uses some bash-specific features not compatible with dash. For example, this line... https://github.com/Unitech/pm2-deploy/blob/987428a6ce402b47bb195ab93a8eafa5ad79c6f5/deploy#L212
bash
...does not expand correctly, treating curly braces as part of the directory name:
Ultimately the point of failure is ssh running commands in whatever is configured to be the default shell: https://github.com/Unitech/pm2-deploy/blob/987428a6ce402b47bb195ab93a8eafa5ad79c6f5/deploy#L122
ssh
It would be great if the script either
Or, if you don't intend to change this behavior, it would be nice if it at least could be mentioned in the docs.
I tried tweaking that part of the script myself, but unfortunately didn't have enough shell knowledge to succeed.
Prior report: https://github.com/Unitech/pm2/issues/1553
Thanks.
Hi there.
Problem
I was trying to deploy my project to a Debian server, which has
dash
configured as the default shell. I was running into weird errors like this:Cause
After some digging, I conjecture that the deployment script uses some
bash
-specific features not compatible withdash
. For example, this line... https://github.com/Unitech/pm2-deploy/blob/987428a6ce402b47bb195ab93a8eafa5ad79c6f5/deploy#L212...does not expand correctly, treating curly braces as part of the directory name:![image](https://user-images.githubusercontent.com/79512127/148726243-acf7a93b-3d6e-489d-8524-ddedc07a73e7.png)
Ultimately the point of failure is
ssh
running commands in whatever is configured to be the default shell: https://github.com/Unitech/pm2-deploy/blob/987428a6ce402b47bb195ab93a8eafa5ad79c6f5/deploy#L122Proposed changes
It would be great if the script either
bash
, which is probably a much easier fix.Or, if you don't intend to change this behavior, it would be nice if it at least could be mentioned in the docs.
I tried tweaking that part of the script myself, but unfortunately didn't have enough shell knowledge to succeed.
Prior report: https://github.com/Unitech/pm2/issues/1553
Thanks.