more style/function tweaks
This commit is contained in:
committed by
Michael Hobbs
parent
89f289b433
commit
aa2415eeb8
18
plugins/storage/subcommands/unmount
Executable file
18
plugins/storage/subcommands/unmount
Executable file
@@ -0,0 +1,18 @@
|
||||
#!/usr/bin/env bash
|
||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
||||
source "$PLUGIN_CORE_AVAILABLE_PATH/storage/functions"
|
||||
source "$PLUGIN_CORE_AVAILABLE_PATH/docker-options/functions"
|
||||
|
||||
storage_unmount_cmd() {
|
||||
local desc="Remove bind-mount, restart app if running"
|
||||
local cmd="storage:unmount"
|
||||
local passed_phases=(deploy run)
|
||||
[[ -z $3 || $4 ]] && dokku_log_fail "storage:unmount requires an app and a two paths divided by colon."
|
||||
verify_app_name "$2" && local APP="$2"
|
||||
verify_paths "$3" && local MOUNT_PATH="$3"
|
||||
check_if_path_exists "$MOUNT_PATH" "$(get_phase_file_path "${passed_phases[@]}")" || dokku_log_fail "Mount path does not exist."
|
||||
remove_passed_docker_option passed_phases[@] "-v $MOUNT_PATH"
|
||||
}
|
||||
|
||||
storage_unmount_cmd "$@"
|
||||
Reference in New Issue
Block a user