From 761b6902b88247aebb748da7ebb9c2ae60718bbd Mon Sep 17 00:00:00 2001 From: redxef Date: Mon, 29 Aug 2022 23:52:14 +0200 Subject: [PATCH] Check that image is specified when running put step. --- src/out | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/out b/src/out index 169a8e6..3e1d1a8 100755 --- a/src/out +++ b/src/out @@ -5,10 +5,15 @@ set -eu [ -e /opt/resource/common ] && cd /opt/resource . ./common +image_repository="$(jq -r .params.image < "$INPUT_FILE")" +if [ -z "$image_repository" ]; then + fail "must specify param `image'" +fi + image_refs_file="$(mktemp -t)" oci_dir="$(mktemp -d)" cd "$oci_dir" -tar xf "$1/$(jq -r .params.image < "$INPUT_FILE")" +tar xf "$1/$image_repository" cd - 1>&2 2>/dev/null crane push "$oci_dir" "$REPOSITORY:$TAG" --image-refs="$image_refs_file"