Skatteetaten / vagrant-hashistack-template

Starter template for development using the vagrantbox Skatteetaten/hashistack
14 stars 8 forks source link

Expand `make clean` to remove all vagrantboxes #84

Open pdmthorsrud opened 4 years ago

pdmthorsrud commented 4 years ago

Feature description

It seems like a lot of people have problems not running make clean after an unsuccessful run or similar. It would be beneficial if the clean target actually removes all virtualbox machines running

Why is it needed?

Better user experience

Suggestion(s)/solution(s) [Optional]

Use the vagrant-cli oops, this is ofc virtualbox and not vagrant!

script from Ole Andre:

VBoxManage list runningvms | awk '{print $$2}' | xargs -I vmid VBoxManage controlvm vmid poweroff
VBoxManage list vms | awk '{print $$2}' | xargs -I vmid VBoxManage unregistervm --delete vmid
vagrant global-status --prune

Im not a hundred percent sure vboxmanage is installed together with virtualbox, should check that as well

⚠️ To not accidentally destroy other boxes that are running, we could introduce a separate method in the Makefile. Something like make destroy-all-running-boxes (very explicit, I know). Although, it needs to be well documented and communicated properly for those who need to use this method when facing errors running the box.

Definition of done

Running make clean removes all running virtualbox machines

Checklist (after created issue)