Merge pull request #67 from dokku/minor-changes

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -1,4 +1,5 @@
#!/usr/bin/env bash #!/usr/bin/env bash
source "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/config"
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
PLUGIN_BASE_PATH="$PLUGIN_PATH" PLUGIN_BASE_PATH="$PLUGIN_PATH"
@@ -6,8 +7,7 @@ if [[ -n $DOKKU_API_VERSION ]]; then
PLUGIN_BASE_PATH="$PLUGIN_ENABLED_PATH" PLUGIN_BASE_PATH="$PLUGIN_ENABLED_PATH"
fi fi
source "$PLUGIN_BASE_PATH/common/functions" source "$PLUGIN_BASE_PATH/common/functions"
source "$(dirname "$0")/functions" source "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/functions"
source "$(dirname "$0")/config"
APP="$1" APP="$1"
for SERVICE in "$PLUGIN_DATA_ROOT"/*; do 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 PLUGIN_CORE_AVAILABLE_PATH="$PLUGIN_PATH"
export POSTGRES_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/fixtures" export POSTGRES_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/fixtures"
export PLUGIN_DATA_ROOT="$POSTGRES_ROOT" export PLUGIN_DATA_ROOT="$POSTGRES_ROOT"
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" 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" mkdir -p "$PLUGIN_DATA_ROOT"
rm -rf "${PLUGIN_DATA_ROOT:?}"/* rm -rf "${PLUGIN_DATA_ROOT:?}"/*