shipit icon indicating copy to clipboard operation
shipit copied to clipboard

ssh-pool 5.2 and 5.3 duplicating '&&' on 'tar' comand ('&& && tar -xzf')

Open rootedy-ffit opened this issue 4 years ago • 10 comments

After update to version 5.2.0 or higher I can't make deploy cause the process break on tar comand:

Running "mkdir -p ~/folder/releases/20200324175447" on host "ip". Running "cd ~/folder/releases/20200324175447 && && tar -xzf tmp-114681sp8i8x2jusj.tar.gz" on host "ip". @ip-err bash: -c: line 0: syntax error near unexpected token '&&' @ip-err bash: -c: line 0: 'cd ~/folder/releases/20200324175447 && && tar -xzf tmp-114681sp8i8x2jusj.tar.gz' 'deploy:update' errored after 20 s Error: Command failed: ssh user@ip "cd ~/folder/releases/20200324175447 && && tar -xzf tmp-114681sp8i8x2jusj.tar.gz" bash: -c: line 0: syntax error near unexpected token '&&' bash: -c: line 0: 'cd ~/folder/releases/20200324175447 && && tar -xzf tmp-114681sp8i8x2jusj.tar.gz'

I'm using windows 10, running the command on the git bash, deploying to a ubuntu 14.04 server.

This is the info on my shipitfile.js:

module.exports = (shipit) => { require('shipit-deploy')(shipit);

shipit.initConfig({ default: { servers: 'user@ip', workspace: '/tmp/folder', repositoryUrl: '[email protected]:user/project.git', ignores: ['.git', 'node_modules'], keepReleases: 5, deleteOnRollback: true, shallowClone: true, yarn: { remote: true, }, }, develop: { deployTo: '~/folder', branch: 'branch', }, });

shipit.on('deployed', () => { shipit.start('pm2:restart'); });

shipit.blTask('pm2:restart', () => { shipit.log('Restarting pm2'); shipit.remote(cd ${shipit.config.deployTo}/current && yarn && pm2 startOrRestart ecosystem.config.js); }); };

rootedy-ffit avatar Mar 24 '20 18:03 rootedy-ffit

We're having the exact same issue.

datagrams avatar Mar 29 '20 15:03 datagrams

A workaround is reinstall the packages with "resolutions" for "ssh-pool" on your package.json:

"resolutions": { "ssh-pool": "5.1.0" },

rootedy-ffit avatar Mar 29 '20 16:03 rootedy-ffit

Hi, is this the same issue created by me https://github.com/shipitjs/shipit/issues/270?

gremo avatar Jun 12 '20 10:06 gremo

Hi, is this the same issue created by me #270?

Yeah, same issue.

rootedy-ffit avatar Jun 12 '20 11:06 rootedy-ffit

Oh, I see. I have put resolutions in my package.json, but still doesn't work. Any clue?

gremo avatar Jun 12 '20 11:06 gremo

Oh, I see. I have put resolutions in my package.json, but still doesn't work. Any clue?

Have you deleted node_modules folder and install the packages again?

rootedy-ffit avatar Jun 12 '20 11:06 rootedy-ffit

Yes, I actually added resolution before doing npm install --save-dev shipit-cli shipit-deploy. Now I deleted node_modules folder and installed deps again, issue remain.

bash: -c: line 0: syntax error near unexpected token &&' bash: -c: line 0: cd ~/colorsgroup/httpdocs/releases/20200612115230 && && tar -xzf tmp-8000Q6I637OV8eGa.tar.gz'

gremo avatar Jun 12 '20 11:06 gremo

Open your node_modules folder, then look for the ssh-pool folder. Open it's package.json, if the resolutions works, the version should be 5.1.0.

rootedy-ffit avatar Jun 12 '20 12:06 rootedy-ffit

I was using npm. Ends up that with npm doesn't support resolutions. With yarn it works. Temporary fix... please fix :)

gremo avatar Jun 12 '20 12:06 gremo

Any update?

gremo avatar Jun 21 '20 21:06 gremo