From f16e55e1a2635dface1018283e30b07187259f79 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Wed, 23 Sep 2015 14:38:04 -0400 Subject: [PATCH 1/2] Fix overlapping exported config If using multiple official dokku datastorage plugins, it is possible to get into a case where the `PLUGIN_DATA_ROOT` would be set incorrectly for other plugins. Refs dokku/dokku-redis#20 --- config | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config b/config index 715bb59..47bdbe8 100755 --- a/config +++ b/config @@ -1,10 +1,10 @@ #!/usr/bin/env bash export REDIS_IMAGE=${REDIS_IMAGE:="redis"} export REDIS_IMAGE_VERSION=${REDIS_IMAGE_VERSION:="3.0.4"} -export REDIS_ROOT=/var/lib/dokku/services/redis +export REDIS_ROOT=${REDIS_ROOT:="/var/lib/dokku/services/redis"} export PLUGIN_COMMAND_PREFIX="redis" -export PLUGIN_DATA_ROOT=${PLUGIN_DATA_ROOT:="$REDIS_ROOT"} +export PLUGIN_DATA_ROOT=$REDIS_ROOT export PLUGIN_DATASTORE_PORTS=(6379) export PLUGIN_DEFAULT_ALIAS="REDIS" export PLUGIN_IMAGE=$REDIS_IMAGE From 37b84c3aa956d2fb334cb5a2b37e0462964f1872 Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Wed, 23 Sep 2015 15:03:58 -0400 Subject: [PATCH 2/2] Set REDIS_ROOT environment variable as well Since PLUGIN_DATA_ROOT is not directly overrideable anymore, we need to *also* set this env var here. --- tests/test_helper.bash | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/test_helper.bash b/tests/test_helper.bash index 88b776d..7932203 100644 --- a/tests/test_helper.bash +++ b/tests/test_helper.bash @@ -8,7 +8,8 @@ export PLUGIN_PATH="$DOKKU_ROOT/plugins" export PLUGIN_ENABLED_PATH="$PLUGIN_PATH" export PLUGIN_AVAILABLE_PATH="$PLUGIN_PATH" export PLUGIN_CORE_AVAILABLE_PATH="$PLUGIN_PATH" -export PLUGIN_DATA_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/fixtures" +export REDIS_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/fixtures" +export PLUGIN_DATA_ROOT="$REDIS_ROOT" mkdir -p "$PLUGIN_DATA_ROOT" rm -rf "${PLUGIN_DATA_ROOT:?}"/*