feat: add aliases for select builder and scheduler plugins

It can get repetitive to specify 'builder-' or 'scheduler-' prefixes for builder and scheduler commands. As these are mostly unique, Dokku now provides built-in aliases for the commands. Dokku still uses the long-form in all it's documentation, but these are a nice easter egg for determined users :)

Note that the null builder/scheduler plugins do not have aliases as they would shadow each other.
This commit is contained in:
Jose Diaz-Gonzalez
2025-11-20 03:11:49 -05:00
parent 553cc232b2
commit 0ef276d40b

22
dokku
View File

@@ -135,6 +135,28 @@ execute_dokku_cmd() {
local script
local argv=("$@")
local -A PLUGIN_ALIASES=(
[docker-local]="scheduler-docker-local"
[dockerfile]="builder-dockerfile"
[herokuish]="builder-herokuish"
[k3s]="scheduler-k3s"
[lambda]="builder-lambda"
[nixpacks]="builder-nixpacks"
[pack]="builder-pack"
[rails]="builder-railpack"
)
local plugin_alias_source="${PLUGIN_NAME%%:*}"
local plugin_alias_target="${PLUGIN_ALIASES[$plugin_alias_source]}"
if [[ -n "$plugin_alias_target" ]]; then
PLUGIN_NAME="${PLUGIN_NAME/$plugin_alias_source/$plugin_alias_target}"
PLUGIN_CMD="${PLUGIN_CMD/$plugin_alias_source/$plugin_alias_target}"
# also replace the first argument in $@ with the new PLUGIN_NAME
shift 1
set -- "$PLUGIN_NAME" "$@"
argv=("$PLUGIN_NAME" "${argv[@]:1}")
fi
case "$PLUGIN_NAME" in
events | events:*)
local PLUGIN_NAME=${PLUGIN_NAME/events/20_events}