From 8a5b946685bea33432f77dba616e2cda67ec90dc Mon Sep 17 00:00:00 2001 From: ThetaDev Date: Sat, 2 Mar 2024 19:39:59 +0100 Subject: [PATCH] small fixes --- action.yml | 2 +- entrypoint.sh | 12 +++++++----- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/action.yml b/action.yml index 2ae14d9..df34098 100644 --- a/action.yml +++ b/action.yml @@ -40,7 +40,7 @@ inputs: description: "Prefix to be stripped from the tag" required: false platforms: - description: "Target platforms to build (separated by comma)" + description: "Target platforms to build (separated by comma); Example: linux/amd64,linux/arm64" required: false extra_args: description: "Additional arguments to be passed to the kaniko executor" diff --git a/entrypoint.sh b/entrypoint.sh index 241c17f..c134869 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -87,13 +87,15 @@ runKaniko() { # https://github.com/GoogleContainerTools/kaniko/issues/1349 IFS='' kaniko_cmd="executor ${1} --reproducible --force" - echo "Running kaniko command ${kaniko_cmd}" + echo "Running kaniko command: ${kaniko_cmd}" eval "${kaniko_cmd}" } -if [ -n "$PLATFORMS" ]; then +if [ -n "$INPUT_PLATFORMS" ]; then # Build image for all platforms, then push the manifest - platformArray=$(echo "$PLATFORMS" | sed 's/,/ /g' ) + platformArray=$(echo "$INPUT_PLATFORMS" | sed 's/,/ /g' ) + echo "Building for the following platforms: $platformArray" + for platform in $platformArray; do platformFn=$(echo "$platform" | sed 's#/#-#g') @@ -117,7 +119,7 @@ if [ -n "$PLATFORMS" ]; then fi manifest_cmd="crane index append $TAGS $DIGESTS" - echo "Running crane command ${manifest_cmd}" + echo "Running crane command: ${manifest_cmd}" IMAGE_TAG_DIGEST=$(eval "$manifest_cmd") else # Build and push image for the default platform @@ -134,6 +136,6 @@ fi DIGEST=$(echo "$IMAGE_TAG_DIGEST" | cut -f2 -d '@') echo "image=$IMAGE" >> "$GITHUB_OUTPUT" echo "digest=$DIGEST" >> "$GITHUB_OUTPUT" -echo "image-tag-digest=IMAGE_TAG_DIGEST" >> "$GITHUB_OUTPUT" +echo "image-tag-digest=$IMAGE_TAG_DIGEST" >> "$GITHUB_OUTPUT" echo "🎉 Successfully built $IMAGE_TAG_DIGEST"