small fixes

This commit is contained in:
ThetaDev
2024-03-02 19:39:59 +01:00
parent ea98c81427
commit 8a5b946685
2 changed files with 8 additions and 6 deletions

View File

@@ -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"

View File

@@ -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"