Allow the remote shell path to be overridden by host config (#1708)

* Allow the remote shell path to be overridden by host config

Allow the remote shell path to be overridden by host config -> right now i have the case that $SHELL is incorrect on the remote but I can't fix it (shared hosting). Secondly with this implementation I can explicitly select the shell via Host Config

* Update SshCommand.php

* Update SshCommand.php

* #1706 php bin/changelog§
This commit is contained in:
Bernhard Zürn 2018-09-22 05:18:39 +02:00 committed by Anton Medvedev
parent 459c895eaf
commit 6625420b42
2 changed files with 11 additions and 1 deletions

View File

@ -4,6 +4,9 @@
## master
[v6.3.0...master](https://github.com/deployphp/deployer/compare/v6.3.0...master)
### Added
- Support to define remote shell path via host-config [#1708] [#1709] [#1709]
### Changed
- Laravel recipe should not run `artisan:cache:clear` in `deploy` task
@ -413,6 +416,8 @@
- Fixed remove of shared dir on first deploy
[#1709]: https://github.com/deployphp/deployer/issues/1709
[#1708]: https://github.com/deployphp/deployer/pull/1708
[#1677]: https://github.com/deployphp/deployer/pull/1677
[#1671]: https://github.com/deployphp/deployer/issues/1671
[#1663]: https://github.com/deployphp/deployer/issues/1663

View File

@ -80,10 +80,15 @@ class SshCommand extends Command
}
}
$shell_path = 'exec $SHELL -l';
if ($host->has('shell_path')) {
$shell_path = 'exec '.$host->get('shell_path').' -l';
}
Context::push(new Context($host, $input, $output));
$options = $host->getSshArguments();
$deployPath = $host->get('deploy_path', '~');
passthru("ssh -t $options $host 'cd '''$deployPath/current'''; exec \$SHELL -l'");
passthru("ssh -t $options $host 'cd '''$deployPath/current'''; $shell_path'");
}
}