-
Notifications
You must be signed in to change notification settings - Fork 254
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
Q: streaming output from an execute
#395
Comments
Indeed writing my own very simple interaction handler does what I want.
So that's awesoe that sshkit is flexible enough to accomodate it. I think this is a common use case though, I'm wondering if it's built in a way I did not notice? |
Hey @jrochkind thanks for the quick spike, that's super interesting - perhaps for now, without closing the door on this topic an entry in the
And, since it's a totally valid use-case, maybe we could think about renaming the interaction handler class and tightening up some of these APIs to become part of our public spec? |
The output I actually wanted to capture was a ruby-progressbar progress bar -- it does something kind of reasonable for non-TTY output, but is still output progress bar markers char-by-char without newlines, which looked weird in the log. So one further refinement, I made the class so if you set Which actually ends up working quite nicely for a ruby-progressbar non-TTY progressbar! I don't know if I'll do a PR anytime soon, I'm in the middle of some yak-shaving, but at least this GH issue stands as google-able docs for anyone looking for a solution (or who wants to take it further into a PR) -- I've found answers in existing GH Issues all the time! |
I did link to this issue and example on the existing StackOverflow i found asking the same thing, that didn't yet have a satisfactory (to me anyway) answer. http://stackoverflow.com/questions/19291438/capistrano-3-x-capture-output-line-by-line/42959611 |
and thanks for the quick response and confirmation that what I'm doing makes some sense! and for sshkit/capistrano! |
Thanks @jrochkind let's leave this here and see if someone comes back to it. I'll label it appropriately. Good luck with the yak shaving. |
Thanks! Fine with me if you close it, it's still here to be googled. Not this issue, but i'm having trouble figuring out if |
It depends on the If you'd like to limit the hosts to just a single host, that's up to you to handle before calling |
This would be a welcome addition, as I have a similar problem with php composer |
I'm not certain if that example still works for me, I think it may have stopped working for me since then, I have not gotten to the bottom of what changed. :( |
I agree it would be awesome if cap could officially handle this use case somehow and document it; I don't currently have the bandwidth to help provide a solution, sorry. |
Using sshkit 1.11.1 via Capistrano 3.4.0.
I'd like to do an
execute
, but get streaming output to the console as it appears from the execute. For me,execute
seems to have no output.capture
can capture output (that you can write out), but only once it's all done, not streaming.Looking at the sshkit README, I think I could write my own
interaction_handler
to do this, not because I actually want any interaction, just to capture and write to console the output as it happens.But it seems like there's probably a built-in way to do this I'm not finding?
The text was updated successfully, but these errors were encountered: