Skip to content

Commit

Permalink
new 'prebuild' variable
Browse files Browse the repository at this point in the history
  • Loading branch information
senolfeldmann committed Sep 15, 2020
1 parent d905939 commit 5b2dd90
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
6 changes: 4 additions & 2 deletions commands/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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..."

Expand All @@ -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
Expand Down
3 changes: 3 additions & 0 deletions plugin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ configuration:
type: boolean
seperate-service-start:
type: boolean
prebuild:
type: boolean
oneOf:
- required:
- run
Expand All @@ -100,3 +102,4 @@ configuration:
user: [ run ]
propagate-uid-gid: [ run ]
seperate-service-start: [ run ]
prebuild: [ run ]

0 comments on commit 5b2dd90

Please sign in to comment.