mirror of
https://github.com/dokku/dokku.git
synced 2025-12-25 16:29:30 +01:00
25 lines
891 B
Bash
Executable File
25 lines
891 B
Bash
Executable File
#!/usr/bin/env bash
|
|
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
|
|
source "$PLUGIN_CORE_AVAILABLE_PATH/common/functions"
|
|
source "$PLUGIN_AVAILABLE_PATH/config/functions"
|
|
|
|
config_docker_args() {
|
|
declare desc="config docker-args plugin trigger"
|
|
local trigger="$0 config_docker_args"
|
|
local STDIN=$(cat); local APP="$1"; local IMAGE_TAG="$2"; local IMAGE=$(get_app_image_name "$APP" "$IMAGE_TAG")
|
|
local DOCKERFILE_ENV_FILE="$DOKKU_ROOT/$APP/DOCKERFILE_ENV_FILE"
|
|
verify_app_name "$APP"
|
|
|
|
if ! is_image_herokuish_based "$IMAGE"; then
|
|
> "$DOCKERFILE_ENV_FILE"
|
|
config_export global | sed -e "s:^export ::g" -e "s:=':=:g" -e "s:'$::g" > "$DOCKERFILE_ENV_FILE"
|
|
config_export app "$APP" | sed -e "s:^export ::g" -e "s:=':=:g" -e "s:'$::g" >> "$DOCKERFILE_ENV_FILE"
|
|
|
|
echo -n "$STDIN --env-file=$DOCKERFILE_ENV_FILE"
|
|
else
|
|
echo -n "$STDIN"
|
|
fi
|
|
}
|
|
|
|
config_docker_args "$@"
|