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
Allow specifying target container for hook execution #1038
Comments
I think this is long-neglected but a really valid application. I wish our existing config language had a spot for the container name. It really allow something like:
|
This seems like a natural progression as people increasingly use custom containers, and I'd imagine there are some use cases for executing hooks on our existing non-web containers now. On the back end, we already support |
@rfay Your solution would be the better one I think, but it would also be a breaking change for many people unless you keep the current syntax for compatibility. I don't know how you will handle breaking changes in stable releases, but this might annoy people when they have to update all their ddev projects with hooks. |
@codemonkey1988 To be honest, I don't think keeping this backwards compatible is that hard. If the Is there any progress made on this? I literally have zero projects where I don't use custom services and this would be a major improvement. |
Thanks for chiming in on this @kristoftorfs - Just an FYI about workarounds you probably already use... If the web container has access to the other service, then hooks can be executed against the web container and take action against another container. For example, since the web container has mysql access to the db container, you can add a hook that does a mysql command. This would likely be a part of #1372, which is about the hook system in general. |
Is your feature request related to a problem? Please describe.
When you want to execute a hook in different container than the web container, you currently need to use the
exec-host
command an runddev exec -s my-service my-command
.Describe the solution you'd like
It would be nice, if you could somehow specify the target container for the hook to execute.
One possible solution could be integrating the services name into the exec command.
Example:
When you got a service named node you can execute a hook in it by using
exec-node
. This solution would keep the current syntax.exec-host
would stay as be special keyword and onlyexec
would be the same asexec-web
(it it might be an alias for compatibility.The whole hook config could look like this:
The text was updated successfully, but these errors were encountered: