Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deployment errors if default shell on remote host is not bash #200

Open
ghost opened this issue Jan 10, 2022 · 0 comments
Open

Deployment errors if default shell on remote host is not bash #200

ghost opened this issue Jan 10, 2022 · 0 comments

Comments

@ghost
Copy link

ghost commented Jan 10, 2022

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:

--> 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

Cause

After some digging, I conjecture that the deployment script uses some bash-specific features not compatible with dash. For example, this line...

run "mkdir -p $path/{shared/{logs,pids},source}"

...does not expand correctly, treating curly braces as part of the directory name:
image

Ultimately the point of failure is ssh running commands in whatever is configured to be the default shell:

$shell $@

Proposed changes

It would be great if the script either

  • was rewritten in a portable style, or
  • executed its remote commands in 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: Unitech/pm2#1553

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

0 participants