From 2c7559c575c5654a2f7842746efea3bf4429fc0f Mon Sep 17 00:00:00 2001 From: Ryan Ernst Date: Wed, 23 May 2018 23:20:13 -0700 Subject: [PATCH] Packaging: Ensure upgrade_is_oss flag file is always deleted (#30732) This commit ensures the delete of the upgrade_is_oss indicator for the packaging tests is always deleted before each run. It works by moving the check on version which skips the task into the doFirst block, replacing the onlyIf. closes #30682 --- .../elasticsearch/gradle/vagrant/VagrantTestPlugin.groovy | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/buildSrc/src/main/groovy/org/elasticsearch/gradle/vagrant/VagrantTestPlugin.groovy b/buildSrc/src/main/groovy/org/elasticsearch/gradle/vagrant/VagrantTestPlugin.groovy index 6e8a5fd15edf1..455d30f95db32 100644 --- a/buildSrc/src/main/groovy/org/elasticsearch/gradle/vagrant/VagrantTestPlugin.groovy +++ b/buildSrc/src/main/groovy/org/elasticsearch/gradle/vagrant/VagrantTestPlugin.groovy @@ -11,6 +11,7 @@ import org.gradle.api.internal.artifacts.dependencies.DefaultProjectDependency import org.gradle.api.tasks.Copy import org.gradle.api.tasks.Delete import org.gradle.api.tasks.Exec +import org.gradle.api.tasks.StopExecutionException import org.gradle.api.tasks.TaskState import static java.util.Collections.unmodifiableList @@ -285,8 +286,10 @@ class VagrantTestPlugin implements Plugin { dependsOn copyPackagingArchives doFirst { project.delete("${archivesDir}/upgrade_is_oss") + if (project.extensions.esvagrant.upgradeFromVersion.before('6.3.0')) { + throw new StopExecutionException("upgrade version is before 6.3.0") + } } - onlyIf { project.extensions.esvagrant.upgradeFromVersion.onOrAfter('6.3.0') } file "${archivesDir}/upgrade_is_oss" contents '' }