Skip to content

Commit 93e2ee5

Browse files
committed
Change logic for require_prebuilt
1 parent 69b94f6 commit 93e2ee5

1 file changed

Lines changed: 7 additions & 9 deletions

File tree

commands/run.sh

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,13 @@ for service_name in "${prebuilt_candidates[@]}" ; do
4949
prebuilt_image="$prebuilt_image_override"
5050
elif prebuilt_image=$(get_prebuilt_image "$prebuilt_image_namespace" "$service_name") ; then
5151
echo "~~~ :docker: Found a pre-built image for $service_name"
52+
else
53+
echo "+++ 🚨 No pre-built image found from a previous 'build' step for service ${service_name} and config file."
54+
55+
if [[ "${BUILDKITE_PLUGIN_DOCKER_COMPOSE_REQUIRE_PREBUILD:-}" =~ ^(true|on|1)$ ]]; then
56+
echo "The step specified that it was required"
57+
exit 1
58+
fi
5259
fi
5360

5461
if [[ -n "$prebuilt_image" ]] ; then
@@ -350,15 +357,6 @@ fi
350357

351358
run_params+=("$run_service")
352359

353-
if [[ ! -f "$override_file" ]] ; then
354-
echo "+++ 🚨 No pre-built image found from a previous 'build' step for this service and config file."
355-
356-
if [[ "${BUILDKITE_PLUGIN_DOCKER_COMPOSE_REQUIRE_PREBUILD:-}" =~ ^(true|on|1)$ ]]; then
357-
echo "The step specified that it was required"
358-
exit 1
359-
fi
360-
fi
361-
362360
up_params+=("up") # this ensures that the array has elements to avoid issues with bash 4.3
363361

364362
if [[ "$(plugin_read_config WAIT "false")" == "true" ]] ; then

0 commit comments

Comments
 (0)