kamal icon indicating copy to clipboard operation
kamal copied to clipboard

Hook-output is hidden unless you're running with `-v`

Open jdelStrother opened this issue 1 year ago • 2 comments

Is it an intentional choice that hook output is hidden unless either the hook fails, or you're running kamal with -v ?

pre-deploy.sample and post-deploy.sample both write stuff to stdout, but neither will get shown by default. Perhaps the run_hook method ought to include KAMAL.with_verbosity(:debug) do ... ?

jdelStrother avatar Nov 22 '24 15:11 jdelStrother

👍 if you're writing to stdout in your hooks you would expect it to be shown imho

joelcogen avatar Dec 11 '24 12:12 joelcogen

We're running migrations in a pre-deploy hook and it's intensely annoying to not be able to see their progress or output unless they fail.

exterm avatar Oct 08 '25 23:10 exterm

Sometimes you'd want the output from hooks and sometimes you wouldn't so there's no simple answer here. Right now we are following the SSHKit convention which is to suppress the output of commands unless you are in verbose mode.

In general we'd like to avoid too many configuration options, but maybe this is one place where we need one.

djmb avatar Nov 28 '25 15:11 djmb

Sometimes you'd want the output from hooks and sometimes you wouldn't so there's no simple answer here. Right now we are following the SSHKit convention which is to suppress the output of commands unless you are in verbose mode.

In general we'd like to avoid too many configuration options, but maybe this is one place where we need one.

Do you have an example where a hook is outputting something that you don't want to see? I think I'd see that as a sign that I should fix my hook, rather than try to hide it.

Is it that you usually have a lot of debugging info in hooks and rely on running with -v if something isn't working right?

jdelStrother avatar Nov 28 '25 16:11 jdelStrother

@djmb I mentioned this in #1665, but at a minimum the sample hooks should probably be changed as some are written as if output does go somewhere. So it's quite misleading when troubleshooting since the examples make it seem like there is something wrong when the text output is missing.

Like I think @jdelStrother is implying, I can't think of a situation where I would have text being intentionally output in a hook (such as with puts in Ruby or echo in Bash) and not want it to be shown in the Kamal output.

jwkicklighter avatar Dec 02 '25 23:12 jwkicklighter