Files
dokku/plugins/scheduler-docker-local/subcommands/set
Jose Diaz-Gonzalez 68d05b230d refactor: simplify file ownership in the container by setting the process ownership during the build process
Rather than require a heavy chown operation across various paths, just chown the files already in the built image during the release process. This ensures we can skip not-only the chown process during the container start that herokuish injects, but also the one that Dokku runs which modifies mounted container paths as well during the pre-deploy.

Note that users will need to ensure any mounted volumes don't have permissions reset by other processes or containers won't be able to access them.
2024-03-12 22:27:39 -04:00

31 lines
1.0 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-scheduler-docker-local-set() {
declare desc="set or clear a scheduler-docker-local property for an app"
declare cmd="scheduler-docker-local:set"
[[ "$1" == "$cmd" ]] && shift 1
declare APP="$1" KEY="$2" VALUE="$3"
local VALID_KEYS=("init-process" "parallel-schedule-count")
verify_app_name "$APP"
[[ -z "$KEY" ]] && dokku_log_fail "No key specified"
if ! fn-in-array "$KEY" "${VALID_KEYS[@]}"; then
dokku_log_fail "Invalid key specified, valid keys include: init-process, parallel-schedule-count"
fi
if [[ -n "$VALUE" ]]; then
dokku_log_info2_quiet "Setting ${KEY} to ${VALUE}"
fn-plugin-property-write "scheduler-docker-local" "$APP" "$KEY" "$VALUE"
else
dokku_log_info2_quiet "Unsetting ${KEY}"
fn-plugin-property-delete "scheduler-docker-local" "$APP" "$KEY"
fi
}
cmd-scheduler-docker-local-set "$@"