-
Notifications
You must be signed in to change notification settings - Fork 990
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
Support running commands on remote servers over SSH #2754
Comments
@westonruter @jonathanbardo Do you recall why you originally used |
@danielbachhuber not exactly, but two reasons come to mind:
|
I think at the time we also needed to be able to ssh into a jump server before reaching the final web server. This was going to be easier to do using |
Thanks guys. I think I'll end up going with |
Debating whether we need to support |
@westonruter @jonathanbardo Would you mind testing out the current implementation when you have a moment, and let me know what you think? Specifically, I'm looking for feedback on the implementation, and any additional features you think it needs. |
@danielbachhuber I agree, SSH config for non standard port number makes sense. |
@timneutkens actually, since you've been using WP-CLI SSH most frequently of late (AFAIK), would you give this PR a try and provide feedback? |
Just to clarify, the code has already landed on master. If you're using the Phar install, you can |
@westonruter @danielbachhuber Will do. Bet I will have time to review this tomorrow. |
Hey @danielbachhuber, looks good :) Only thing I noticed is that Few weeks ago I created a pull request on wp-cli-ssh (xwp/wp-cli-ssh#27) to add support for a custom command to be ran. So you could do something like: The hook you implemented probably solves the issue I had wanting to use a different php command for wp-cli. Just not the part where you would want to use a different path to the command. |
That was intentional, although I could be convinced otherwise.
Well, my thinking is that you could create a just-in-time alias to a different path, if WP-CLI wasn't available as What do you think about my explanation? |
That's a fair point. You could alias |
I also noticed that you can provide |
I figured out a syntax for us to support port:
If the port isn't specified, then 22 is assumed:
|
I agree, that's the best syntax for supporting ports 👍 |
Git uses a syntax without a colon between port and path:
|
Since it's a standard URL format, it should be parseable with PHP's |
I agree, I'll update. |
Actually,
|
Feeling pretty good with this now as a v1. I'll handle website documentation as a part of #2767 |
Thanks Daniel, will have to make so changes to our internal setup 👍 |
How would I do it if I usually login with : |
@toleabivol You'll need to set a SSH config with the identity file reference. |
As a WP-CLI user, it would be convenient if I could use a global
--ssh=<host>
argument to run a command against a WordPress install on a remote server:To modify the behavior of the command at runtime, it should be possible to hook in a custom command:
https://github.com/xwp/wp-cli-ssh is good prior art from @westonruter and @jonathanbardo that we can crib from.
The text was updated successfully, but these errors were encountered: