Files
dokku/plugins/config/docker-args-deploy
Jose Diaz-Gonzalez 2474c87bbd Pull the deploying app image name where necessary
All of these commands should execute against the image that is in use versus the "latest" that dokku provides the system with.
2016-07-29 12:49:29 -04:00

25 lines
901 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_deploying_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 "$@"