Merge pull request #49 from dokku/minor-changes

Minor changes
This commit is contained in:
Jose Diaz-Gonzalez
2016-05-08 03:49:00 -04:00
8 changed files with 29 additions and 24 deletions

View File

@@ -3,5 +3,6 @@ dist: trusty
language: bash
env:
- DOKKU_VERSION=master
- DOKKU_VERSION=v0.4.14
before_install: make setup
script: make test

View File

@@ -4,18 +4,13 @@ Official redis plugin for dokku. Currently defaults to installing [redis 3.0.7](
## requirements
- dokku 0.4.0+
- dokku 0.4.x+
- docker 1.8.x
## installation
```shell
# on 0.3.x
cd /var/lib/dokku/plugins
git clone https://github.com/dokku/dokku-redis.git redis
dokku plugins-install
# on 0.4.x
# on 0.4.x+
dokku plugin:install https://github.com/dokku/dokku-redis.git redis
```

View File

@@ -1,4 +1,6 @@
#!/usr/bin/env bash
source "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/config"
[[ " help $PLUGIN_COMMAND_PREFIX:help " == *" $1 "* ]] || [[ "$1" == "$PLUGIN_COMMAND_PREFIX:"* ]] || exit "$DOKKU_NOT_IMPLEMENTED_EXIT"
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
PLUGIN_BASE_PATH="$PLUGIN_PATH"
@@ -6,13 +8,10 @@ if [[ -n $DOKKU_API_VERSION ]]; then
PLUGIN_BASE_PATH="$PLUGIN_ENABLED_PATH"
fi
source "$PLUGIN_BASE_PATH/common/functions"
source "$(dirname "$0")/functions"
source "$(dirname "$0")/config"
source "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/functions"
if [[ $1 == $PLUGIN_COMMAND_PREFIX:* ]]; then
if [[ ! -d $PLUGIN_DATA_ROOT ]]; then
dokku_log_fail "$PLUGIN_SERVICE: Please run: sudo dokku plugin:install"
fi
if [[ ! -d $PLUGIN_DATA_ROOT ]]; then
dokku_log_fail "$PLUGIN_SERVICE: Please run: sudo dokku plugin:install"
fi
if [[ -d "$PLUGIN_DATA_ROOT/*" ]]; then

View File

@@ -1,6 +1,6 @@
#!/usr/bin/env bash
source "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/config"
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
source "$(dirname "$0")/config"
source "$PLUGIN_AVAILABLE_PATH/config/functions"
get_random_ports() {
@@ -298,8 +298,8 @@ service_url() {
echo "$PLUGIN_SCHEME://$SERVICE_ALIAS:${PLUGIN_DATASTORE_PORTS[0]}"
}
is_container_status () {
local CID=$1
is_container_status() {
local CID="$1"
local TEMPLATE="{{.State.$2}}"
local CONTAINER_STATUS=$(docker inspect -f "$TEMPLATE" "$CID" || true)
@@ -376,7 +376,7 @@ service_linked_apps() {
}
update_plugin_scheme_for_app() {
local APP=$1
local REDIS_DATABASE_SCHEME=$(config_get $APP REDIS_DATABASE_SCHEME)
local APP="$1"
local REDIS_DATABASE_SCHEME=$(config_get "$APP" REDIS_DATABASE_SCHEME)
PLUGIN_SCHEME=${REDIS_DATABASE_SCHEME:-$PLUGIN_SCHEME}
}

View File

@@ -1,16 +1,16 @@
#!/usr/bin/env bash
source "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/config"
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
source "$(dirname "$0")/config"
if ! docker images | grep -e "^$PLUGIN_IMAGE " | grep -q "$PLUGIN_IMAGE_VERSION" ; then
docker pull "$PLUGIN_IMAGE:$PLUGIN_IMAGE_VERSION"
fi
if ! docker images | grep -e "^svendowideit/ambassador "; then
if ! docker images | grep -q -e "^svendowideit/ambassador "; then
docker pull svendowideit/ambassador:latest
fi
if ! docker images | grep -e "^dokkupaas/wait "; then
if ! docker images | grep -q -e "^dokkupaas/wait "; then
docker pull dokkupaas/wait:latest
fi

View File

@@ -1,4 +1,5 @@
#!/usr/bin/env bash
source "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/config"
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
PLUGIN_BASE_PATH="$PLUGIN_PATH"
@@ -6,8 +7,7 @@ if [[ -n $DOKKU_API_VERSION ]]; then
PLUGIN_BASE_PATH="$PLUGIN_ENABLED_PATH"
fi
source "$PLUGIN_BASE_PATH/common/functions"
source "$(dirname "$0")/functions"
source "$(dirname "$0")/config"
source "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/functions"
APP="$1"
for SERVICE in "$PLUGIN_DATA_ROOT"/*; do

6
tests/bin/lsb_release Executable file
View File

@@ -0,0 +1,6 @@
#!/usr/bin/env bash
if [[ "$(uname)" == "Darwin" ]]; then
echo "Darwin"
else
echo "Ubuntu"
fi

View File

@@ -10,7 +10,11 @@ export PLUGIN_AVAILABLE_PATH="$PLUGIN_PATH"
export PLUGIN_CORE_AVAILABLE_PATH="$PLUGIN_PATH"
export REDIS_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/fixtures"
export PLUGIN_DATA_ROOT="$REDIS_ROOT"
export PLUGN_URL="https://github.com/dokku/plugn/releases/download/v0.2.1/plugn_0.2.1_linux_x86_64.tgz"
if [[ "$(uname)" == "Darwin" ]]; then
export PLUGN_URL="https://github.com/dokku/plugn/releases/download/v0.2.1/plugn_0.2.1_darwin_x86_64.tgz"
else
export PLUGN_URL="https://github.com/dokku/plugn/releases/download/v0.2.1/plugn_0.2.1_linux_x86_64.tgz"
fi
mkdir -p "$PLUGIN_DATA_ROOT"
rm -rf "${PLUGIN_DATA_ROOT:?}"/*