fix: allow config directory to be configurable

For postgres, the config directory doesn't actually exist, so adding this configurability allows the plugin's info command to report correctly.
This commit is contained in:
Jose Diaz-Gonzalez
2020-05-16 02:49:34 -04:00
parent ba24332367
commit 56f688e8aa
3 changed files with 3 additions and 2 deletions

View File

@@ -383,7 +383,7 @@ service_info() {
local flag key valid_flags local flag key valid_flags
local flag_map=( local flag_map=(
"--config-dir: ${SERVICE_ROOT}/config" "--config-dir: ${SERVICE_ROOT}/${PLUGIN_CONFIG_SUFFIX}"
"--data-dir: ${SERVICE_ROOT}/data" "--data-dir: ${SERVICE_ROOT}/data"
"--dsn: ${SERVICE_URL}" "--dsn: ${SERVICE_URL}"
"--exposed-ports: $(service_exposed_ports "$SERVICE")" "--exposed-ports: $(service_exposed_ports "$SERVICE")"

1
config
View File

@@ -21,6 +21,7 @@ export PLUGIN_SCHEME="postgres"
export PLUGIN_SERVICE="Postgres" export PLUGIN_SERVICE="Postgres"
export PLUGIN_VARIABLE="POSTGRES" export PLUGIN_VARIABLE="POSTGRES"
export PLUGIN_BASE_PATH="$PLUGIN_PATH" export PLUGIN_BASE_PATH="$PLUGIN_PATH"
export PLUGIN_CONFIG_SUFFIX="data"
if [[ -n $DOKKU_API_VERSION ]]; then if [[ -n $DOKKU_API_VERSION ]]; then
export PLUGIN_BASE_PATH="$PLUGIN_ENABLED_PATH" export PLUGIN_BASE_PATH="$PLUGIN_ENABLED_PATH"
fi fi

View File

@@ -45,7 +45,7 @@ service-destroy-cmd() {
service_container_rm "$SERVICE" service_container_rm "$SERVICE"
dokku_log_verbose_quiet "Removing data" dokku_log_verbose_quiet "Removing data"
docker run --rm -v "$SERVICE_HOST_ROOT/data:/data" -v "$SERVICE_HOST_ROOT/config:/config" "$PLUGIN_BUSYBOX_IMAGE" chmod 777 -R /config /data docker run --rm -v "$SERVICE_HOST_ROOT/data:/data" -v "$SERVICE_HOST_ROOT/$PLUGIN_CONFIG_SUFFIX:/config" "$PLUGIN_BUSYBOX_IMAGE" chmod 777 -R /config /data
rm -rf "$SERVICE_ROOT" rm -rf "$SERVICE_ROOT"
dokku_log_info2 "$PLUGIN_SERVICE container deleted: $SERVICE" dokku_log_info2 "$PLUGIN_SERVICE container deleted: $SERVICE"