From ce0c7f2e44bc8b515bc9c95e22af1d7e5f159c13 Mon Sep 17 00:00:00 2001 From: Brandon Olin <12634452+devblackops@users.noreply.github.com> Date: Fri, 2 Sep 2022 08:36:48 -0700 Subject: [PATCH] Support expanding env vars on the extra_build_args parameter (#149) * use eval for build args * remove extra quote * fix: syntax for appending in array Co-authored-by: Eric Ribeiro --- src/scripts/build.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/scripts/build.sh b/src/scripts/build.sh index e9c1ac8..c83fd32 100644 --- a/src/scripts/build.sh +++ b/src/scripts/build.sh @@ -4,7 +4,7 @@ DOCKER_TAGS_ARG="" parse_tags_to_docker_arg() { # Set comma as the new delimiter for the scope of this function. - local IFS="," + local IFS="," # Split tags into an array based on IFS delimiter. read -ra tags <<< "$PARAM_TAG" @@ -47,12 +47,13 @@ if [ -n "$PARAM_CACHE_FROM" ]; then fi build_args=( - "--file=$PARAM_DOCKERFILE_PATH/$PARAM_DOCKERFILE_NAME" - "$DOCKER_TAGS_ARG" + "--file=$PARAM_DOCKERFILE_PATH/$PARAM_DOCKERFILE_NAME" + "$DOCKER_TAGS_ARG" ) if [ -n "$PARAM_EXTRA_BUILD_ARGS" ]; then - build_args+=("$PARAM_EXTRA_BUILD_ARGS") + extra_build_args="$(eval echo "$PARAM_EXTRA_BUILD_ARGS")" + build_args+=("$extra_build_args") fi if [ -n "$PARAM_CACHE_FROM" ]; then