Skip to content

Commit

Permalink
Use onlyIf for build Docker image task execution (elastic#54047)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
jasontedor authored Mar 24, 2020
1 parent 408311d commit f39aa75
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion distribution/docker/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -191,8 +191,8 @@ void addBuildDockerImage(final String architecture, final boolean oss) {
]
}
}
buildDockerImageTask.onlyIf { Architecture.current().name().toLowerCase().equals(architecture) }
assemble.dependsOn(buildDockerImageTask)
buildDockerImageTask.enabled = Architecture.current().name().toLowerCase().equals(architecture)
}

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

0 comments on commit f39aa75

Please sign in to comment.