refactor: add initial support for builder plugins

A builder plugin implements some method for 'building' artifacts from a given source code archive. This refactor moves the majority of the image building code into separate plugins, allowing us to implement other builders, but also simplifying the common pugin codebase.

Also move the pre-build-buildpack hook from the build-env plugin to builder-herokuish.
This commit is contained in:
Jose Diaz-Gonzalez
2019-07-30 14:29:48 -04:00
parent af8ade0a09
commit 0a8d5eb744
15 changed files with 209 additions and 124 deletions

View File

@@ -0,0 +1,19 @@
#!/usr/bin/env bash
set -eo pipefail
[[ $DOKKU_TRACE ]] && set -x
trigger-builder-release-builder-dockerfile() {
declare desc="builder-dockerfile builder-release plugin trigger"
declare trigger="trigger-builder-release-builder-dockerfile"
declare BUILDER_TYPE="$1" APP="$2" IMAGE_TAG="$3"
if [[ "$BUILDER_TYPE" != "herokuish" ]]; then
return
fi
# buildstep plugins don't necessarily make sense for dockerfiles. call the new breed!!!
plugn trigger pre-release-dockerfile "$APP" "$IMAGE_TAG"
plugn trigger post-release-dockerfile "$APP" "$IMAGE_TAG"
}
trigger-builder-release-builder-dockerfile "$@"