Skip to content

Commit

Permalink
Support expanding env vars on the extra_build_args parameter (#149)
Browse files Browse the repository at this point in the history
* use eval for build args

* remove extra quote

* fix: syntax for appending in array

Co-authored-by: Eric Ribeiro <[email protected]>
  • Loading branch information
devblackops and EricRibeiro authored Sep 2, 2022
1 parent 87dc209 commit ce0c7f2
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit ce0c7f2

Please sign in to comment.