Destroy test VMs on clean (#28818)

This commit adds a dependency on the destroy task to the clean task so
that the VMs are destroyed when the clean task is executed.
This commit is contained in:
Jason Tedor 2018-02-25 17:02:38 -05:00 committed by GitHub
parent c9ed49da10
commit f66234bdd5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions

View File

@ -258,6 +258,9 @@ class VagrantTestPlugin implements Plugin<Project> {
private static void createVagrantBoxesTasks(Project project) {
assert project.extensions.esvagrant.boxes != null
final Task clean = project.tasks.clean
assert clean != null
assert project.tasks.stop != null
Task stop = project.tasks.stop
@ -334,6 +337,7 @@ class VagrantTestPlugin implements Plugin<Project> {
}
destroy.onlyIf { vagrantDestroy }
update.mustRunAfter(destroy)
clean.dependsOn(destroy)
Task up = project.tasks.create("vagrant${boxTask}#up", VagrantCommandTask) {
command 'up'