mirror of
https://github.com/dokku/dokku.git
synced 2026-09-01 19:49:25 +02:00
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
48 lines
1.8 KiB
Bash
Executable File
48 lines
1.8 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
set -eo pipefail
|
|
[[ $DOKKU_TRACE ]] && set -x
|
|
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
|
source "$PLUGIN_CORE_AVAILABLE_PATH/common/property-functions"
|
|
|
|
cmd-checks-skip() {
|
|
declare desc="skip zero-downtime checks for app/proctypes"
|
|
declare cmd="checks:skip"
|
|
[[ "$1" == "$cmd" ]] && shift 1
|
|
declare APP="$1"
|
|
|
|
verify_app_name "$APP"
|
|
local PROCTYPES="${2:-_all_}"
|
|
local DOKKU_CHECKS_DISABLED=$(fn-plugin-property-get-default "checks" "$APP" "disabled" "")
|
|
local DOKKU_CHECKS_SKIPPED=$(fn-plugin-property-get-default "checks" "$APP" "skipped" "")
|
|
|
|
if [[ "$PROCTYPES" == "_all_" ]]; then
|
|
dokku_log_info1 "Skipping zero downtime for app ($APP)"
|
|
fn-plugin-property-write "checks" "$APP" "skipped" "$PROCTYPES"
|
|
fn-plugin-property-delete "checks" "$APP" "disabled"
|
|
else
|
|
dokku_log_info1 "Skipping zero downtime for app's ($APP) proctypes ($PROCTYPES)"
|
|
local PROCTYPE OIFS="$IFS" IFS=,
|
|
for PROCTYPE in $PROCTYPES; do
|
|
IFS="$OIFS"
|
|
[[ "$(is_val_in_list "$PROCTYPE" "$DOKKU_CHECKS_SKIPPED")" == "false" ]] \
|
|
&& DOKKU_CHECKS_SKIPPED="$(add_val_to_list "$PROCTYPE" "$DOKKU_CHECKS_SKIPPED")"
|
|
[[ "$(is_val_in_list "$PROCTYPE" "$DOKKU_CHECKS_DISABLED")" == "true" ]] \
|
|
&& DOKKU_CHECKS_DISABLED="$(remove_val_from_list "$PROCTYPE" "$DOKKU_CHECKS_DISABLED")"
|
|
done
|
|
DOKKU_CHECKS_SKIPPED="$(remove_val_from_list "_all_" "$DOKKU_CHECKS_SKIPPED")"
|
|
if [[ -z "$DOKKU_CHECKS_DISABLED" ]]; then
|
|
fn-plugin-property-delete "checks" "$APP" "disabled"
|
|
else
|
|
fn-plugin-property-write "checks" "$APP" "disabled" "$DOKKU_CHECKS_DISABLED"
|
|
fi
|
|
|
|
if [[ -z "$DOKKU_CHECKS_SKIPPED" ]]; then
|
|
fn-plugin-property-delete "checks" "$APP" "skipped"
|
|
else
|
|
fn-plugin-property-write "checks" "$APP" "skipped" "$DOKKU_CHECKS_SKIPPED"
|
|
fi
|
|
fi
|
|
}
|
|
|
|
cmd-checks-skip "$@"
|