mirror of
https://github.com/dokku/dokku.git
synced 2025-12-29 00:25:08 +01:00
29 lines
907 B
Bash
Executable File
29 lines
907 B
Bash
Executable File
#!/usr/bin/env bash
|
|
set -eo pipefail
|
|
[[ $DOKKU_TRACE ]] && set -x
|
|
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
|
source "$PLUGIN_AVAILABLE_PATH/docker-options/functions"
|
|
|
|
cmd-docker-options-clear() {
|
|
declare desc="clear a docker options from application"
|
|
declare cmd="docker-options:clear"
|
|
[[ "$1" == "$cmd" ]] && shift 1
|
|
declare APP="$1" PHASES="$2"
|
|
|
|
verify_app_name "$APP"
|
|
|
|
if [[ -z "$PHASES" ]]; then
|
|
dokku_log_info1 "Clearing docker-options for $APP on all phases"
|
|
rm -f "$(fn-get-phase-file-path "$APP" "build")" "$(fn-get-phase-file-path "$APP" "deploy")" "$(fn-get-phase-file-path "$APP" "run")"
|
|
return
|
|
fi
|
|
|
|
read -ra passed_phases <<<"$(get_phases "$PHASES")"
|
|
for phase in "${passed_phases[@]}"; do
|
|
dokku_log_info1 "Clearing docker-options for $APP on phase $phase"
|
|
rm -f "$(fn-get-phase-file-path "$APP" "$phase")"
|
|
done
|
|
}
|
|
|
|
cmd-docker-options-clear "$@"
|