From e76bb13edff4c3176353e96e519727c96cc87d98 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Guitaut?= Date: Tue, 8 Sep 2015 10:34:29 +0200 Subject: [PATCH] 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. --- commands | 10 +++------- dependencies | 15 --------------- 2 files changed, 3 insertions(+), 22 deletions(-) delete mode 100755 dependencies diff --git a/commands b/commands index 0da81ea..c459a39 100755 --- a/commands +++ b/commands @@ -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) diff --git a/dependencies b/dependencies deleted file mode 100755 index 4df3e70..0000000 --- a/dependencies +++ /dev/null @@ -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