From c687409a352968505dd7a9ebae423ac734bb9cc5 Mon Sep 17 00:00:00 2001 From: Kristoffer Dalby Date: Tue, 20 Aug 2019 13:46:53 +0100 Subject: [PATCH] adds build_args_from_env option --- plugin.sh | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/plugin.sh b/plugin.sh index 6333c34..a54157b 100755 --- a/plugin.sh +++ b/plugin.sh @@ -47,13 +47,9 @@ if [ -n "${PLUGIN_BUILD_ARGS:-}" ]; then fi if [ -n "${PLUGIN_BUILD_ARGS_FROM_ENV:-}" ]; then - BUILD_ARGS_FROM_ENV=$(echo "${PLUGIN_BUILD_ARGS_FROM_ENV}" | tr ',' '\n' | while read build_arg; do echo "--build-arg=${build_arg}=${!build_arg}"; done) + BUILD_ARGS_FROM_ENV=$(echo "${PLUGIN_BUILD_ARGS_FROM_ENV}" | tr ',' '\n' | while read build_arg; do echo "--build-arg ${build_arg}=$(eval "echo \$$build_arg")"; done) fi -echo "BUILD_ARGS_FROM_ENV" -echo ${BUILD_ARGS_FROM_ENV:-} -echo "BUILD_ARGS_FROM_ENV END" - if [ -n "${PLUGIN_TAGS:-}" ]; then DESTINATIONS=$(echo "${PLUGIN_TAGS}" | tr ',' '\n' | while read tag; do echo "--destination=${REGISTRY}/${PLUGIN_REPO}:${tag} "; done) elif [ -f .tags ]; then @@ -73,4 +69,5 @@ fi ${DESTINATIONS} \ ${CACHE:-} \ ${TARGET:-} \ - ${BUILD_ARGS:-} + ${BUILD_ARGS:-} \ + ${BUILD_ARGS_FROM_ENV:-}