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.
29 lines
771 B
Bash
Executable File
29 lines
771 B
Bash
Executable File
#!/usr/bin/env bash
|
|
set -eo pipefail
|
|
[[ $DOKKU_TRACE ]] && set -x
|
|
source "$PLUGIN_AVAILABLE_PATH/config/functions"
|
|
|
|
trigger-docker-args-builder-herokuish() {
|
|
declare desc="builder-herokuish docker-args plugin trigger"
|
|
declare trigger="trigger-docker-args-builder-herokuish"
|
|
local APP="$1"
|
|
local STDIN
|
|
local DOKKU_APP_TYPE
|
|
local DOKKU_APP_USER
|
|
|
|
STDIN=$(cat)
|
|
DOKKU_APP_TYPE=$(config_get "$APP" DOKKU_APP_TYPE || true)
|
|
DOKKU_APP_USER=$(config_get "$APP" DOKKU_APP_USER || true)
|
|
DOKKU_APP_USER=${DOKKU_APP_USER:="herokuishuser"}
|
|
|
|
if [[ "$DOKKU_APP_TYPE" == "herokuish" ]]; then
|
|
local docker_args="$STDIN --env=USER=${DOKKU_APP_USER}"
|
|
else
|
|
local docker_args="$STDIN"
|
|
fi
|
|
|
|
echo -n "$docker_args"
|
|
}
|
|
|
|
trigger-docker-args-builder-herokuish "$@"
|