Files
dokku/plugins/builder-herokuish/docker-args-build
Jose Diaz-Gonzalez 5d5d56c560 refactor: remove public exposure of DOKKU_APP_TYPE in favor of builder detected property
The DOKKU_APP_TYPE has long since ceased to be the correct way to specify the builder for the application. It's only usage has been during the detection phase, specifically to ensure that the herokuish plugin injects the correct docker arguments during the build. As such, it is safe to migrate away to a property in a patch release.

Users that seek to set a specific builder should use 'dokku builder:set $APP selected' instead.

Refs #7863
2025-08-21 23:59:41 -04:00

27 lines
757 B
Bash
Executable File

#!/usr/bin/env bash
set -eo pipefail
[[ $DOKKU_TRACE ]] && set -x
source "$PLUGIN_AVAILABLE_PATH/config/functions"
trigger-builder-herokuish-docker-args() {
declare desc="builder-herokuish docker-args plugin trigger"
declare trigger="docker-args"
declare APP="$1"
local STDIN DOKKU_APP_TYPE DOKKU_APP_USER
STDIN=$(cat)
DOKKU_APP_TYPE="$(plugn trigger builder-get-property "$APP" "detected" || 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-builder-herokuish-docker-args "$@"