Add core storage plugin to manage docker bind mounts [ci skip]

This commit is contained in:
Justin Clark
2016-01-13 12:00:28 -08:00
parent 8c01fa8480
commit 84df69b387
7 changed files with 163 additions and 0 deletions

18
plugins/storage/functions Executable file
View 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"
}