Use redis-cli from docker image

Instead of installing dependencies on the host, directly use the binary
shipped with the redis docker image. This will also prevent possible
problems when API change for example.
This commit is contained in:
Loïc Guitaut
2015-09-08 10:34:29 +02:00
parent 803b66e8ae
commit e76bb13edf
2 changed files with 3 additions and 22 deletions

View File

@@ -8,10 +8,6 @@ if [[ ! -d $PLUGIN_DATA_ROOT ]]; then
dokku_log_fail "$PLUGIN_SERVICE: Please run: sudo dokku plugins-install"
fi
if ! command -v redis-cli &>/dev/null; then
dokku_log_fail "$PLUGIN_SERVICE: Please run: sudo dokku plugins-install-dependencies"
fi
case "$1" in
$PLUGIN_COMMAND_PREFIX:alias)
[[ -z $2 ]] && dokku_log_fail "Please specify a name for the service"
@@ -155,10 +151,10 @@ case "$1" in
[[ -z $2 ]] && dokku_log_fail "Please specify a name for the service"
verify_service_name "$2"
SERVICE="$2"; SERVICE_ROOT="$PLUGIN_DATA_ROOT/$SERVICE"
SERVICE_NAME=$(get_service_name "$SERVICE")
ID=$(cat "$SERVICE_ROOT/ID")
IP=$(get_container_ip "$ID")
redis-cli -h "$IP" -p 6379
# shellcheck disable=SC2016
docker run -it --link "$SERVICE_NAME:redis" --rm "$PLUGIN_IMAGE" sh -c 'exec redis-cli -h "$REDIS_PORT_6379_TCP_ADDR" -p "$REDIS_PORT_6379_TCP_PORT"'
;;
$PLUGIN_COMMAND_PREFIX:info)

View File

@@ -1,15 +0,0 @@
#!/usr/bin/env bash
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
source "$(dirname "$0")/config"
case "$DOKKU_DISTRO" in
ubuntu)
export DEBIAN_FRONTEND=noninteractive
apt-get update
apt-get install -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" --force-yes -qq -y redis-tools
;;
opensuse)
zypper -q in -y redis-tools
;;
esac