Hook-output is hidden unless you're running with `-v`
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 ... ?
👍 if you're writing to stdout in your hooks you would expect it to be shown imho
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.
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.
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?
@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.