No bash or arrays in busybox sh

This commit is contained in:
Patrik Lundin 2025-02-05 20:38:29 +01:00
parent 2138c52c9c
commit d4bbe84196
Signed by: patlu
GPG key ID: A0A812BA2249F294

View file

@ -1,4 +1,4 @@
#!/usr/bin/env bash
#!/bin/sh
# Setup auth
echo '{"auths":{"'"$(printf "%s" "$INPUT_REGISTRY")"'":{"auth":"'"$(printf "%s" "$INPUT_CREDENTIAL" | base64 | tr -d '\n')"'"}}}' > /kaniko/.docker/config.json
@ -8,11 +8,11 @@ if [ -n "$INPUT_WORKDIR" ]; then
printf 'cd %s -> %s\n' "$OLDPWD" "$PWD"
fi
options=()
context_flag=""
if [ -n "$INPUT_CONTEXT" ]; then
options+=('--context')
options+=("$INPUT_CONTEXT")
context_flag="--context"
context_flag_val="$INPUT_CONTEXT"
fi
# Build container
/kaniko/executor --dockerfile "$INPUT_DOCKERFILE" --destination "$INPUT_REGISTRY/$INPUT_IMAGE" "${options[@]}"
/kaniko/executor --dockerfile "$INPUT_DOCKERFILE" --destination "$INPUT_REGISTRY/$INPUT_IMAGE" "$context_flag" "$context_flag_val"