-
Notifications
You must be signed in to change notification settings - Fork 4
initial feedback? #3
Description
This is my fourth or fifth pass implementing the functionality included in this gem... I first did it directly in an app, then in Capistrano, then in SSHKit, then finally (after taking the "don't push your pull request" advice to heart) as a standalone gem 😅
Backstory
The problem stemmed from wanting to open a Rails console on the server, without me (and all of my teammates) having to manually set up my SSH config. I created a Rake task to generate an SSH config via the AWS API, but figured "hey, there are a bunch of remote commands I want to be able to run... this sounds like a job for Capistrano."
I assumed this would be easy, buuuuut our deployment setup has the complication of a gateway/NAT/proxy/jump server (those are all synonyms, right?) in front of it. All of the examples I could find only handle the most basic of SSH connections:
- https://github.com/ydkn/capistrano-rails-console/blob/dbe6b8b2a4a9d3e06a8d356a0dde3076b2b125bc/lib/capistrano/rails/console/tasks/remote.cap#L16
- https://gist.github.com/toobulkeh/8214198#file-deploy-rb-L25
- http://www.pablocantero.com/blog/2014/06/16/opening-a-rails-console-with-capistrano-3/
- http://stackoverflow.com/a/18174136/358804
- https://gist.github.com/col/4560969#file-deploy-rb-L52
"Ok," I thought, "well maybe it's something I can easily initiate from SSHKit..." but apparently that's not the case. The capistrano/console approach of an endless loop around an execute didn't seem like it would work, either. It seemed that shelling out to ssh was the way to go, but I wanted a way to generate the command automatically from the Capistrano::Configuration::Server. That's where this gem came in.
Halp?
I would love feedback on the overall approach, code, documentation, etc. The gem is far from comprehensive (particularly in covering all possible ssh_options), but I'm logging issues as I go. My thinking is that SSHKit::Interactive can be integrated into other Capistrano plugins, using shared logic for generating the ssh command.
CCing people who I saw in various threads who may be interested (no particular order) – #sorrynotsorry for the spam 😉 Thanks!
/cc @leehambley @jgrevich @miry @ydkn @toobulkeh @phstc @Haihappen @chrisbloom7 @col @joost