numtide / devshell

Per project developer environments
https://numtide.github.io/devshell/
MIT License
1.18k stars 86 forks source link

service.stopCommand or similar for better cleanup #279

Open kate-shine opened 10 months ago

kate-shine commented 10 months ago

Is your feature request related to a problem? Please describe.

Currently, each serviceGroup creates two shell scripts, <group.name>:start and <group.name>:stop

It's impossible to define how be each service stopped. In some cases, it would be a nice feature to have ability to do it myself (or even define cleanup process)

Examples of commands from my recent devshell that spawns necessary services for running tests:

(Default generated :stop script is unable to shut down both spawned minikube and podman containers)

Describe the solution you'd like

Another attribute, for example stopCommand. It could be also an array of commands.

Describe alternatives you've considered

for now, I'm defining "test_cleanup" command for shell that does the same thing, but it feels like a less than ideal approach

Additional context