diff --git a/commands/run.sh b/commands/run.sh index 5214b1fb..842b2d19 100755 --- a/commands/run.sh +++ b/commands/run.sh @@ -172,12 +172,13 @@ while read -r arg ; do [[ -n "${arg:-}" ]] && build_params+=("--build-arg" "${arg}") done <<< "$(plugin_read_list ARGS)" -if [[ "${BUILDKITE_PLUGIN_DOCKER_COMPOSE_REQUIRE_PREBUILD:-}" =~ ^(true|on|1)$ ]] && [[ ! -f "$override_file" ]] ; then +if [[ "$(plugin_read_config PREBUILD "true")" == "true" ]] ; then + if [[ "${BUILDKITE_PLUGIN_DOCKER_COMPOSE_REQUIRE_PREBUILD:-}" =~ ^(true|on|1)$ ]] && [[ ! -f "$override_file" ]] ; then echo "+++ 🚨 No pre-built image found from a previous 'build' step for this service and config file." echo "The step specified that it was required" exit 1 -elif [[ ! -f "$override_file" ]]; then + elif [[ ! -f "$override_file" ]]; then echo "~~~ :docker: Building Docker Compose Service: $run_service" >&2 echo "⚠️ No pre-built image found from a previous 'build' step for this service and config file. Building image..." @@ -188,6 +189,7 @@ elif [[ ! -f "$override_file" ]]; then # Sometimes docker-compose pull leaves unfinished ansi codes echo + fi fi if [[ "$(plugin_read_config SEPERATE_SERVICE_START "true")" == "true" ]] ; then diff --git a/plugin.yml b/plugin.yml index f35b8304..9f341537 100644 --- a/plugin.yml +++ b/plugin.yml @@ -74,6 +74,8 @@ configuration: type: boolean seperate-service-start: type: boolean + prebuild: + type: boolean oneOf: - required: - run @@ -100,3 +102,4 @@ configuration: user: [ run ] propagate-uid-gid: [ run ] seperate-service-start: [ run ] + prebuild: [ run ]