From 3334a1b20f14183fb08a19889780460b2e36078d Mon Sep 17 00:00:00 2001 From: Juan Eugenio Abadie Date: Sun, 21 Feb 2021 15:23:18 -0300 Subject: [PATCH] Fix BUILD_EXTRA_ARGS json input --- docker-build.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/docker-build.sh b/docker-build.sh index 7e6ff3f..2bf0fdf 100755 --- a/docker-build.sh +++ b/docker-build.sh @@ -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="" } @@ -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 }