As briefly discussed in #1425, source the `common/functions` file via an absolute path, rather than determining the relative path by using `dirname`. 3rd-party plugins should follow suit and use the new `$PLUGIN_PATH` convention too.
17 lines
616 B
Bash
Executable File
17 lines
616 B
Bash
Executable File
#!/usr/bin/env bash
|
|
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
|
source "$PLUGIN_PATH/common/functions"
|
|
|
|
STDIN=$(cat); APP="$1"; IMAGE="dokku/$APP"
|
|
DOCKERFILE_ENV_FILE="$DOKKU_ROOT/$APP/DOCKERFILE_ENV_FILE"
|
|
|
|
if ! is_image_herokuish_based "$IMAGE"; then
|
|
> "$DOCKERFILE_ENV_FILE"
|
|
[[ -f "$DOKKU_ROOT/ENV" ]] && sed -e "s:^export ::g" -e "s:=':=:g" -e "s:'$::g" "$DOKKU_ROOT/ENV" > "$DOCKERFILE_ENV_FILE"
|
|
[[ -f "$DOKKU_ROOT/$APP/ENV" ]] && sed -e "s:^export ::g" -e "s:=':=:g" -e "s:'$::g" "$DOKKU_ROOT/$APP/ENV" >> "$DOCKERFILE_ENV_FILE"
|
|
|
|
echo "$STDIN --env-file=$DOCKERFILE_ENV_FILE"
|
|
else
|
|
echo "$STDIN"
|
|
fi
|