Skip to content

Commit

Permalink
feat: support multiple targets
Browse files Browse the repository at this point in the history
  • Loading branch information
tboerger committed Nov 11, 2021
1 parent eb67e5f commit 8fe4330
Showing 1 changed file with 20 additions and 17 deletions.
37 changes: 20 additions & 17 deletions overlay/usr/local/bin/entrypoint
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/usr/bin/env bash
set -eo pipefail

manifest-tool --version
pushd "${GITHUB_WORKSPACE}" >/dev/null
ARGS=()

Expand All @@ -27,27 +28,29 @@ pushd "${GITHUB_WORKSPACE}" >/dev/null
ARGS+=(--ignore-missing)
fi

ARGS+=("${INPUT_SPEC}")
manifest-tool "${ARGS[*]} ${INPUT_SPEC}"
else
ARGS+=(push from-args)
for TARGET in ${INPUT_TARGET}; do
VERSION=$(echo "${TARGET}" | cut -d: -f2)
LOOP=("${ARGS[@]}" push from-args)

if [[ -n "${INPUT_IGNORE_MISSING}" && "${INPUT_IGNORE_MISSING}" == "true" ]]; then
ARGS+=(--ignore-missing)
fi
if [[ -n "${INPUT_IGNORE_MISSING}" && "${INPUT_IGNORE_MISSING}" == "true" ]]; then
LOOP+=(--ignore-missing)
fi

if [[ -n "${INPUT_PLATFORMS}" ]]; then
ARGS+=(--platforms "${INPUT_PLATFORMS}")
fi
if [[ -n "${INPUT_PLATFORMS}" ]]; then
LOOP+=(--platforms "${INPUT_PLATFORMS}")
fi

if [[ -n "${INPUT_TEMPLATE}" ]]; then
ARGS+=(--template "${INPUT_TEMPLATE}")
fi
if [[ -n "${INPUT_TEMPLATE}" ]]; then
LOOP+=(--template "${INPUT_TEMPLATE/VERSION/$VERSION}")
fi

if [[ -n "${INPUT_TARGET}" ]]; then
ARGS+=(--target "${INPUT_TARGET}")
fi
fi
if [[ -n "${TARGET}" ]]; then
LOOP+=(--target "${TARGET}")
fi

manifest-tool --version
manifest-tool "${ARGS[@]}"
manifest-tool "${LOOP[*]}"
done
fi
popd >/dev/null

0 comments on commit 8fe4330

Please sign in to comment.