saltyorg / sb

0 stars 9 forks source link

add commands to remove or purge apps #8

Open saltydk opened 1 year ago

saltydk commented 1 year ago

Removal would just remove the container and optionally remove the dns record tied to the machine (unsure if we should mess with dns) Purge would remove the container and prompt the user if any of the found opt folders (common ones excluded) should be removed as well. Prompt to confirm any data removal.

Suggested template for looking up the folders

docker inspect tautulli | jq -r '.[0].Mounts[] | select(.Source | startswith("/opt")).Source'

If we decide to manage the removal of dns records we could add additional label(s) to specify which are tied to the container instead of hoping traefik labels will stay in the same format.

As currently constructed this would be scoped to container based apps and multiple containers in the same app would still need some kind of label pairing (fairly easy to add going forward) to link them together for this tool to more easily find them in one go. Removal of the paired containers could be optional.

keldian commented 1 year ago

Maybe have two commands, mimicking apt behavior.

sb remove foo
sb purge foo

When the command is issued, print a rundown of what exactly will be removed, awaiting confirmation.

saltydk commented 1 year ago

I feel like we should leave the image cleanup to the docker role.

saltydk commented 1 year ago

Or add a short hand command for it with sb maybe to pair with this.