Running SSH Commands in PhpStorm
I can see two places that seem to make it possible to do something like this.
1. Command Line Tools, if configured, it seems to be possible to connect to SSH and run commands (but I could be mistaken)
2. Under Tools menu, there's a Run Command option
Has anyone tried using either of the above methods to connect to SSH and run commands? I have a deployment script I want to run as soon as I'm done uploading, which is basically running a PHP script (inaccessible via web). I can keep Terminal up (on a Mac) I guess, but it would be cool to just do it all from within the IDE. I'm aware there's a vote up for an internal SSH client, but didn't know if anyone had dealt with workarounds yet.
Thanks in advance!
请先登录再写评论。
Hi Scott,
As far as I'm aware #1 and #2 are the same (#2 will open Command Line Tools Console where you can type those commands).
I'm not using SSH myself (have not dealt with it for a long time, and even then it was all manual typing commands), but you can create some batch/bash script that will do all the job (connect to server, execute remote commands etc) and then call it from PhpStorm using External Tools functionality (Settings | External Tools). If you are using Phing tasks in your deployment/build process, you can call such script from there as well (as separate task or part of another task).
Aha! That did it!
For others' enjoyment, the process I went through was:
Optional - Set Keymap:
Figuring all of this out has been awesome, I now see visions of crazy scripts and time saving stuff going on in my near future! Thanks for the pointer, I absolutely couldn't have figured this out without you saying this should be an External Tool!