Add core storage plugin to manage docker bind mounts [ci skip]
This commit is contained in:
18
plugins/storage/functions
Executable file
18
plugins/storage/functions
Executable file
@@ -0,0 +1,18 @@
|
||||
#!/usr/bin/env bash
|
||||
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
||||
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
||||
|
||||
verify_paths() {
|
||||
echo "$1" | grep -qe '^/.*\:/' || dokku_log_fail "Storage path must be two valid paths devided by colon."
|
||||
}
|
||||
|
||||
check_if_path_exists() {
|
||||
local -r passed_path=$1
|
||||
local -r phase_file_path=$2
|
||||
[[ -r "$phase_file_path" ]] && grep -qe "^-v $passed_path" "$phase_file_path"
|
||||
}
|
||||
|
||||
get_bind_mounts() {
|
||||
local -r phase_file_path=$1
|
||||
[[ -r "$phase_file_path" ]] && sed -e '/^-v/!d' -e 's/^-v/ /' < "$phase_file_path"
|
||||
}
|
||||
Reference in New Issue
Block a user