Skip to content

Commit

Permalink
Fix BUILD_EXTRA_ARGS json input
Browse files Browse the repository at this point in the history
  • Loading branch information
whoan committed Feb 21, 2021
1 parent d05bc83 commit 3334a1b
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions docker-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -210,14 +210,15 @@ _parse_extra_args() {
fi

# json
declare -gA extra_args
declare -ga extra_args
local key
local value
while read -r key; do
value=$(_remove_quotes "$(jq ".$key" <<<"${INPUT_BUILD_EXTRA_ARGS}")")
key=$(_remove_quotes "$key")
extra_args[$key]="${value//\\n/
}"
extra_args+=("$key")
extra_args+=("${value//\\n/
}")
done < <(jq "keys[]" <<<"${INPUT_BUILD_EXTRA_ARGS}")
INPUT_BUILD_EXTRA_ARGS=""
}
Expand Down Expand Up @@ -309,7 +310,7 @@ build_image() {
--tag "$DUMMY_IMAGE_NAME" \
--file "${INPUT_CONTEXT}"/"${INPUT_DOCKERFILE}" \
${INPUT_BUILD_EXTRA_ARGS} \
${extra_args[@]@K} \
"${extra_args[@]}" \
"${INPUT_CONTEXT}" | tee "$BUILD_LOG"
set +x
}
Expand Down

0 comments on commit 3334a1b

Please sign in to comment.