feat: migrate environment variables to plugin properties

Standardize how environment variables are migrated to properties during
install triggers and migrate all remaining DOKKU_* config vars to their
appropriate plugin properties.

Adds a reusable MigrateConfigToProperties() function in the common
package with Transform callback and ListProperty support, plus a
migrate-config-to-property subcommand for the prop binary so shell
plugins can use the same code path.

Migrated variables and their new property owners:
- DOKKU_APP_PROXY_TYPE/DOKKU_PROXY_TYPE → proxy type
- DOKKU_DISABLE_PROXY → proxy disabled
- DOKKU_PROXY_PORT → ports proxy-port
- DOKKU_PROXY_SSL_PORT → ports proxy-ssl-port
- DOKKU_APP_RESTORE → ps restore
- DOKKU_SKIP_DEPLOY → ps skip-deploy
- DOKKU_START_CMD → ps start-cmd
- DOKKU_DOCKERFILE_START_CMD → ps dockerfile-start-cmd
- DOKKU_DISABLE_APP_AUTOCREATION → apps disable-autocreation
- DOKKU_APP_SHELL → scheduler shell
- DOKKU_SKIP_CLEANUP → builder skip-cleanup
- DOKKU_CHECKS_DISABLED → checks disabled
- DOKKU_CHECKS_SKIPPED → checks skipped
- DOKKU_CHECKS_WAIT → checks wait
- DOKKU_CHECKS_TIMEOUT → checks timeout
- DOKKU_CHECKS_ATTEMPTS → checks attempts
- DOKKU_DEFAULT_CHECKS_WAIT → checks default-wait
- DOKKU_SKIP_ALL_CHECKS → checks disabled (legacy)
- DOKKU_SKIP_DEFAULT_CHECKS → checks skipped (legacy)

Also refactors existing bespoke migration loops in scheduler, ports, ps,
builder, and nginx-vhosts plugins to use the standardized utility.

Removes DOKKU_PARALLEL_ARGUMENTS from documentation (unused in core).
Deprecates fn-migrate-config-to-property bash function.

closes #1558
This commit is contained in:
Jose Diaz-Gonzalez
2026-04-25 05:11:07 -04:00
parent 71ec612fbd
commit 1308e21947
45 changed files with 604 additions and 468 deletions

View File

@@ -122,7 +122,7 @@ fn-scheduler-docker-local-extract-start-cmd() {
return
fi
DOKKU_DOCKERFILE_START_CMD=$(config_get "$APP" DOKKU_DOCKERFILE_START_CMD || true)
DOKKU_DOCKERFILE_START_CMD=$(fn-plugin-property-get-default "ps" "$APP" "dockerfile-start-cmd" "")
DOKKU_PROCFILE_START_CMD=$(plugn trigger procfile-get-command "$APP" "$PROC_TYPE" "$PORT" 2>/dev/null || echo '')
START_CMD=${DOKKU_DOCKERFILE_START_CMD:-$DOKKU_PROCFILE_START_CMD}
echo "$START_CMD"

View File

@@ -59,21 +59,17 @@ trigger-scheduler-docker-local-check-deploy() {
local DOKKU_APP_CONTAINER_ID=${DOKKU_APP_CIDS[0]}
fi
# source global and in-app envs to get DOKKU_CHECKS_WAIT and any other necessary vars
eval "$(config_export global)"
eval "$(config_export app "$APP")"
if [[ "$(is_app_proctype_checks_skipped "$APP" "$DOKKU_APP_CONTAINER_TYPE")" == "true" ]]; then
dokku_log_info2_quiet "Zero downtime checks have been skipped ($DOKKU_APP_CONTAINER_TYPE.$CONTAINER_INDEX)"
exit 0
fi
# Wait this many seconds (default 5) for server to start before running checks.
local WAIT="${DOKKU_CHECKS_WAIT:-5}"
local WAIT="$(fn-plugin-property-get-default "checks" "$APP" "wait" "5")"
# Wait this many seconds (default 30) for each response.
local TIMEOUT="${DOKKU_CHECKS_TIMEOUT:-30}"
local TIMEOUT="$(fn-plugin-property-get-default "checks" "$APP" "timeout" "30")"
# use this number of retries for checks
local ATTEMPTS="${DOKKU_CHECKS_ATTEMPTS:-5}"
local ATTEMPTS="$(fn-plugin-property-get-default "checks" "$APP" "attempts" "5")"
local CHECKS_FILENAME="$(fn-scheduler-docker-local-get-process-specific-checks-file-path "$APP")"
local IMAGE_TAG="$(get_running_image_tag "$APP")"
@@ -121,7 +117,7 @@ trigger-scheduler-docker-local-check-deploy() {
}
trap "checks_check_deploy_cleanup $APP $DOKKU_APP_CONTAINER_TYPE $DOKKU_APP_CONTAINER_ID $CONTAINER_INDEX $TMP_APP_JSON_OUTPUT" RETURN INT TERM EXIT
local DOKKU_DEFAULT_CHECKS_WAIT="${DOKKU_DEFAULT_CHECKS_WAIT:-10}"
local DOKKU_DEFAULT_CHECKS_WAIT="$(fn-plugin-property-get-default "checks" "--global" "default-wait" "10")"
content="$(docker-container-healthchecker add "$DOKKU_APP_CONTAINER_TYPE" --app-json "$TMP_APP_JSON_OUTPUT" --if-empty --pretty --uptime "$DOKKU_DEFAULT_CHECKS_WAIT")"
echo "$content" >"$TMP_APP_JSON_OUTPUT"

View File

@@ -35,7 +35,7 @@ trigger-scheduler-docker-local-scheduler-deploy() {
DOKKU_DOCKER_STOP_TIMEOUT="$(plugn trigger ps-get-property "$APP" stop-timeout-seconds)"
[[ $DOKKU_DOCKER_STOP_TIMEOUT ]] && DOCKER_STOP_TIME_ARG="-t=${DOKKU_DOCKER_STOP_TIMEOUT}"
DOKKU_START_CMD="$(config_get "$APP" DOKKU_START_CMD || true)"
DOKKU_START_CMD="$(fn-plugin-property-get-default "ps" "$APP" "start-cmd" "")"
local PROCFILE_EXISTS=false
if plugn trigger procfile-exists "$APP" 2>/dev/null; then

View File

@@ -92,10 +92,9 @@ trigger-scheduler-docker-local-scheduler-enter() {
shift
fi
local DOKKU_APP_SHELL="/bin/bash"
DOKKU_APP_SHELL="$(config_get --global DOKKU_APP_SHELL || echo "$DOKKU_APP_SHELL")"
DOKKU_APP_SHELL="$(config_get "$APP" DOKKU_APP_SHELL || echo "$DOKKU_APP_SHELL")"
[[ -z "$DOKKU_APP_SHELL" ]] && DOKKU_APP_SHELL="/bin/bash"
local DOKKU_APP_SHELL
DOKKU_APP_SHELL="$(fn-plugin-property-get-default "scheduler" "$APP" "shell" "")"
[[ -z "$DOKKU_APP_SHELL" ]] && DOKKU_APP_SHELL="$(fn-plugin-property-get-default "scheduler" "--global" "shell" "/bin/bash")"
local EXEC_CMD=""
has_tty && local DOKKU_RUN_OPTS+=" -i -t"

View File

@@ -137,8 +137,8 @@ trigger-scheduler-docker-local-scheduler-run() {
RUN_COMMAND=("$@")
if [[ "${#RUN_COMMAND[@]}" -eq 0 ]]; then
if [[ -z "$DOKKU_SHELL" ]]; then
local DOKKU_APP_SHELL=$(config_get "$APP" DOKKU_APP_SHELL || true)
local DOKKU_GLOBAL_SHELL=$(config_get --global DOKKU_APP_SHELL || true)
local DOKKU_APP_SHELL=$(fn-plugin-property-get-default "scheduler" "$APP" "shell" "")
local DOKKU_GLOBAL_SHELL=$(fn-plugin-property-get-default "scheduler" "--global" "shell" "")
local DOKKU_SHELL=${DOKKU_APP_SHELL:="$DOKKU_GLOBAL_SHELL"}
fi