Support locally-installed redis.conf

This commit is contained in:
Jody McIntyre
2018-04-04 15:42:22 -04:00
parent 4d9dcb3f29
commit 8cc870a1bb

View File

@@ -36,7 +36,11 @@ service_create() {
mkdir -p "$SERVICE_ROOT" || dokku_log_fail "Unable to create service directory" mkdir -p "$SERVICE_ROOT" || dokku_log_fail "Unable to create service directory"
mkdir -p "$SERVICE_ROOT/data" || dokku_log_fail "Unable to create service data directory" mkdir -p "$SERVICE_ROOT/data" || dokku_log_fail "Unable to create service data directory"
mkdir -p "$SERVICE_ROOT/config" || dokku_log_fail "Unable to create service config directory" mkdir -p "$SERVICE_ROOT/config" || dokku_log_fail "Unable to create service config directory"
if [[ -z $REDIS_CONFIG_PATH ]] ; then
curl -sSL "https://raw.githubusercontent.com/antirez/redis/${PLUGIN_IMAGE_VERSION:0:3}/redis.conf" > "$SERVICE_ROOT/config/redis.conf" || dokku_log_fail "Unable to download the default redis.conf to the config directory" curl -sSL "https://raw.githubusercontent.com/antirez/redis/${PLUGIN_IMAGE_VERSION:0:3}/redis.conf" > "$SERVICE_ROOT/config/redis.conf" || dokku_log_fail "Unable to download the default redis.conf to the config directory"
else
cp "$REDIS_CONFIG_PATH" "$SERVICE_ROOT/config/redis.conf"
fi
PASSWORD=$(openssl rand -hex 32) PASSWORD=$(openssl rand -hex 32)
if [[ -n "$SERVICE_PASSWORD" ]]; then if [[ -n "$SERVICE_PASSWORD" ]]; then
PASSWORD="$SERVICE_PASSWORD" PASSWORD="$SERVICE_PASSWORD"