46 lines
1.3 KiB
Bash
Executable File
46 lines
1.3 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
|
source "$PLUGIN_CORE_AVAILABLE_PATH/common/property-functions"
|
|
set -eo pipefail
|
|
[[ $DOKKU_TRACE ]] && set -x
|
|
|
|
cmd-builder-nixpacks-report() {
|
|
declare desc="displays a builder-nixpacks report for one or more apps"
|
|
declare cmd="builder-nixpacks:report"
|
|
[[ "$1" == "$cmd" ]] && shift 1
|
|
declare APP="$1" INFO_FLAG="$2"
|
|
|
|
if [[ -n "$APP" ]] && [[ "$APP" == --* ]]; then
|
|
INFO_FLAG="$APP"
|
|
APP=""
|
|
fi
|
|
|
|
if [[ -z "$APP" ]] && [[ -z "$INFO_FLAG" ]]; then
|
|
INFO_FLAG="true"
|
|
fi
|
|
|
|
if [[ -z "$APP" ]]; then
|
|
for app in $(dokku_apps); do
|
|
cmd-builder-nixpacks-report-single "$app" "$INFO_FLAG" | tee || true
|
|
done
|
|
else
|
|
cmd-builder-nixpacks-report-single "$APP" "$INFO_FLAG"
|
|
fi
|
|
}
|
|
|
|
cmd-builder-nixpacks-report-single() {
|
|
declare APP="$1" INFO_FLAG="$2"
|
|
verify_app_name "$APP"
|
|
|
|
dokku_log_info2_quiet "${APP} builder-nixpacks information"
|
|
local NIXPACK_KEYS="$(fn-builder-nixpacks-valid-keys)"
|
|
for key in $NIXPACK_KEYS ; do
|
|
local result="$(fn-plugin-property-get "builder-nixpacks" "$APP" "$key")"
|
|
dokku_log_verbose "$(printf "%-30s %-40s" "${key}" "${result}")"
|
|
done
|
|
}
|
|
|
|
fn-builder-nixpacks-valid-keys() {
|
|
echo "build-cmd cache-key env install-cmd libs pkgs start-cmd"
|
|
}
|