Skip to content

Commit c1c9f7a

Browse files
committed
Use onlyIf for build Docker image task execution (#54047)
This commit switches to using an onlyIf to determine if a build Docker image task execution should occur. This is preferred since it means that the determination is performed at task execution time, rather than during configuration.
1 parent 4bd853a commit c1c9f7a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

distribution/docker/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,8 +190,8 @@ void addBuildDockerImage(final String architecture, final boolean oss) {
190190
]
191191
}
192192
}
193+
buildDockerImageTask.onlyIf { Architecture.current().name().toLowerCase().equals(architecture) }
193194
assemble.dependsOn(buildDockerImageTask)
194-
buildDockerImageTask.enabled = Architecture.current().name().toLowerCase().equals(architecture)
195195
}
196196

197197
for (final String architecture : ["aarch64", "x64"]) {

0 commit comments

Comments
 (0)