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.
This commit is contained in:
Jason Tedor 2020-03-23 22:50:43 -04:00
parent 4bd853a6f2
commit c1c9f7a735
No known key found for this signature in database
GPG Key ID: FA89F05560F16BC5

View File

@ -190,8 +190,8 @@ void addBuildDockerImage(final String architecture, final boolean oss) {
] ]
} }
} }
buildDockerImageTask.onlyIf { Architecture.current().name().toLowerCase().equals(architecture) }
assemble.dependsOn(buildDockerImageTask) assemble.dependsOn(buildDockerImageTask)
buildDockerImageTask.enabled = Architecture.current().name().toLowerCase().equals(architecture)
} }
for (final String architecture : ["aarch64", "x64"]) { for (final String architecture : ["aarch64", "x64"]) {