diff --git a/common-functions b/common-functions index 3e36add..aa4f026 100755 --- a/common-functions +++ b/common-functions @@ -328,6 +328,7 @@ service_linked_apps() { local SERVICE_ROOT="$PLUGIN_DATA_ROOT/$SERVICE" local LINKS_FILE="$SERVICE_ROOT/LINKS" + touch "$LINKS_FILE" [[ -z $(< "$LINKS_FILE") ]] && echo '-' && return 0 tr '\n' ' ' < "$LINKS_FILE" diff --git a/config b/config index bce024e..e2c05a2 100644 --- a/config +++ b/config @@ -2,10 +2,9 @@ export MONGO_IMAGE=${MONGO_IMAGE:="mongo"} export MONGO_IMAGE_VERSION=${MONGO_IMAGE_VERSION:="3.2.9"} export MONGO_ROOT=${MONGO_ROOT:="/var/lib/dokku/services/mongo"} -export MONGO_CONFIG_OPTIONS=${MONGO_CONFIG_OPTIONS:=" --storageEngine wiredTiger --auth "} export PLUGIN_COMMAND_PREFIX="mongo" -export PLUGIN_CONFIG_ROOT="${DOKKU_LIB_ROOT}/config/${PLUGIN_COMMAND_PREFIX}" +export PLUGIN_CONFIG_ROOT=${PLUGIN_CONFIG_ROOT:="$DOKKU_LIB_ROOT/config/$PLUGIN_COMMAND_PREFIX"} export PLUGIN_DATA_ROOT=$MONGO_ROOT export PLUGIN_DATASTORE_PORTS=(27017 27018 27019 28017) export PLUGIN_DATASTORE_WAIT_PORT=27017 @@ -24,3 +23,5 @@ fi if [[ -d "$PLUGIN_DATA_ROOT/*" ]]; then rm -rf "${PLUGIN_DATA_ROOT:?}/*" fi + +export MONGO_CONFIG_OPTIONS=${MONGO_CONFIG_OPTIONS:=" --storageEngine wiredTiger --auth "} diff --git a/tests/test_helper.bash b/tests/test_helper.bash index c8e3f0f..f2e0b2e 100644 --- a/tests/test_helper.bash +++ b/tests/test_helper.bash @@ -10,6 +10,7 @@ export PLUGIN_AVAILABLE_PATH="$PLUGIN_PATH" export PLUGIN_CORE_AVAILABLE_PATH="$PLUGIN_PATH" export MONGO_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/fixtures" export PLUGIN_DATA_ROOT="$MONGO_ROOT" +export PLUGIN_CONFIG_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/config" if [[ "$(uname)" == "Darwin" ]]; then export PLUGN_URL="https://github.com/dokku/plugn/releases/download/v0.3.0/plugn_0.3.0_darwin_x86_64.tgz" else @@ -19,6 +20,9 @@ fi mkdir -p "$PLUGIN_DATA_ROOT" rm -rf "${PLUGIN_DATA_ROOT:?}"/* +mkdir -p "$PLUGIN_CONFIG_ROOT" +rm -rf "${PLUGIN_CONFIG_ROOT:?}"/* + flunk() { { if [ "$#" -eq 0 ]; then cat - else echo "$*"