Skip to content

Commit

Permalink
Ensure all created boxes are destroyed
Browse files Browse the repository at this point in the history
  • Loading branch information
p0deje committed Feb 10, 2015
1 parent 813a2c9 commit 00e6d21
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions Rakefile
Expand Up @@ -14,7 +14,17 @@ namespace :features do

desc 'Removes testing vagrant box.'
task(:cleanup) do
system('bundle exec vagrant destroy -f')
system('bundle exec vagrant box remove vagrant_exec virtualbox')
system('bundle exec vagrant box remove --force vagrant_exec')

# For some reason, vagrant destroy ID fails for us
# so let's just stick to pure VirtualBox

`VBoxManage list vms`
.split("\n")
.select { |line| line =~ /aruba_(default|vagrant)/ }
.map { |line| line.match(/\{([\w-]+)\}/)[1] }
.each { |uuid| system("VBoxManage unregistervm #{uuid} -delete") }

system('bundle exec vagrant global-status --prune')
end
end

0 comments on commit 00e6d21

Please sign in to comment.