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:
parent
c9ed49da10
commit
f66234bdd5
|
@ -258,6 +258,9 @@ class VagrantTestPlugin implements Plugin<Project> {
|
||||||
private static void createVagrantBoxesTasks(Project project) {
|
private static void createVagrantBoxesTasks(Project project) {
|
||||||
assert project.extensions.esvagrant.boxes != null
|
assert project.extensions.esvagrant.boxes != null
|
||||||
|
|
||||||
|
final Task clean = project.tasks.clean
|
||||||
|
assert clean != null
|
||||||
|
|
||||||
assert project.tasks.stop != null
|
assert project.tasks.stop != null
|
||||||
Task stop = project.tasks.stop
|
Task stop = project.tasks.stop
|
||||||
|
|
||||||
|
@ -334,6 +337,7 @@ class VagrantTestPlugin implements Plugin<Project> {
|
||||||
}
|
}
|
||||||
destroy.onlyIf { vagrantDestroy }
|
destroy.onlyIf { vagrantDestroy }
|
||||||
update.mustRunAfter(destroy)
|
update.mustRunAfter(destroy)
|
||||||
|
clean.dependsOn(destroy)
|
||||||
|
|
||||||
Task up = project.tasks.create("vagrant${boxTask}#up", VagrantCommandTask) {
|
Task up = project.tasks.create("vagrant${boxTask}#up", VagrantCommandTask) {
|
||||||
command 'up'
|
command 'up'
|
||||||
|
|
Loading…
Reference in New Issue