libcompose
                                
                                 libcompose copied to clipboard
                                
                                    libcompose copied to clipboard
                            
                            
                            
                        flexing up libcompose to call other pluggable elements?
@vdemeester and other matinainers - just wanted to run by you if there is any interest in taking a PR that does following: https://github.com/jainvipin/libcompose/tree/deploy/deploy
It provides a very simple hook along the following lines https://github.com/jainvipin/libcompose/blob/deploy/cli/app/app.go#L42
Feel free to close the issue if this looks like a hack/noise...
I might not completely understand your use case, but I think something equivalent can be accomplished without the hooks. You can create custom commands while reusing the existing command definitions from cli/command/command.go. Then you can swap out the command action with whatever you'd like while leaving the rest of the command the same. In your case, you could create a new action that does the following.
- Runs any pre-hook functions
- Runs the existing action
- Runs any post-hook functions
@joshwget - thanks, few follow-ups:
- The intent of the command itself is same (up/stop/scale/etc.) but the network policy creation is automated alongside running the application composition. Thus keeping the same Ux is a desire because that semantics doesn't change when composition is run/stopped/scaled/etc.
- Modifying the command in cli/command/command.gowould require that project/services/etc isderived again in the pre/post function. I was hoping to leverage all that with project hook, for example as in https://github.com/jainvipin/libcompose/blob/deploy/deploy/nethooks/policy.go