Skip to content

Commit 947aae6

Browse files
committed
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
1 parent c303956 commit 947aae6

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

buildSrc/src/main/groovy/org/elasticsearch/gradle/vagrant/VagrantTestPlugin.groovy

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import org.gradle.api.internal.artifacts.dependencies.DefaultProjectDependency
1111
import org.gradle.api.tasks.Copy
1212
import org.gradle.api.tasks.Delete
1313
import org.gradle.api.tasks.Exec
14+
import org.gradle.api.tasks.StopExecutionException
1415
import org.gradle.api.tasks.TaskState
1516

1617
class VagrantTestPlugin implements Plugin<Project> {
@@ -188,8 +189,10 @@ class VagrantTestPlugin implements Plugin<Project> {
188189
dependsOn copyPackagingArchives
189190
doFirst {
190191
project.delete("${archivesDir}/upgrade_is_oss")
192+
if (project.extensions.esvagrant.upgradeFromVersion.before('6.3.0')) {
193+
throw new StopExecutionException("upgrade version is before 6.3.0")
194+
}
191195
}
192-
onlyIf { project.extensions.esvagrant.upgradeFromVersion.onOrAfter('6.3.0') }
193196
file "${archivesDir}/upgrade_is_oss"
194197
contents ''
195198
}

0 commit comments

Comments
 (0)