Skip to content

Commit

Permalink
Rework how config vars are sourced
Browse files Browse the repository at this point in the history
- ensure we source config/functions from the correct directory
- move config sourcing up before DOKKU_TRACE to reduce trace output
  • Loading branch information
josegonzalez committed May 8, 2016
1 parent 9925faa commit 9f1bb27
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions commands
@@ -1,13 +1,13 @@
#!/usr/bin/env bash
source "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/config"
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x

PLUGIN_BASE_PATH="$PLUGIN_PATH"
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
Expand Down
2 changes: 1 addition & 1 deletion functions
@@ -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() {
Expand Down
2 changes: 1 addition & 1 deletion install
@@ -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"

if ! docker images | grep -e "^$PLUGIN_IMAGE " | grep -q "$PLUGIN_IMAGE_VERSION" ; then
docker pull "$PLUGIN_IMAGE:$PLUGIN_IMAGE_VERSION"
Expand Down
4 changes: 2 additions & 2 deletions pre-delete
@@ -1,13 +1,13 @@
#!/usr/bin/env bash
source "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/config"
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x

PLUGIN_BASE_PATH="$PLUGIN_PATH"
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
Expand Down

0 comments on commit 9f1bb27

Please sign in to comment.