Fix version output formatting.

This commit is contained in:
redxef 2022-08-29 20:41:16 +02:00
parent d323eae3c3
commit 4acfbf252a
Signed by: redxef
GPG key ID: 7DAC3AA211CBD921
3 changed files with 3 additions and 8 deletions

View file

@ -4,9 +4,4 @@ set -eu
[ -e /opt/resource/common ] && cd /opt/resource [ -e /opt/resource/common ] && cd /opt/resource
. ./common . ./common
jq --null-input --arg version "$(crane digest "$REPOSITORY:$TAG")" '[$version]'
jq -r tostring << EOF
[
$(crane digest "$REPOSITORY:$TAG")
]
EOF

2
src/in
View file

@ -11,4 +11,4 @@ cd "$oci_dir"
tar cf "$1/image.tar" ./* tar cf "$1/image.tar" ./*
cd - 1>&2 cd - 1>&2
echo "$(jq -r .version < "$INPUT_FILE")" echo "$(jq .version < "$INPUT_FILE")"

View file

@ -11,4 +11,4 @@ cd "$oci_dir"
tar xf "$1/$(jq -r .params.image < "$INPUT_FILE")" tar xf "$1/$(jq -r .params.image < "$INPUT_FILE")"
cd - 1>&2 cd - 1>&2
crane push "$oci_dir" "$REPOSITORY:$TAG" --image-refs="$IMAGE_REFS_FILE" crane push "$oci_dir" "$REPOSITORY:$TAG" --image-refs="$IMAGE_REFS_FILE"
sed 's/^[^@]*@//' < "$IMAGE_REFS_FILE" jq --null-input --arg version "$(sed 's/^[^@]*@//' < "$IMAGE_REFS_FILE")" '$version'