rewrite response building.
This commit is contained in:
parent
ab5e2f6420
commit
5da68d0f59
3 changed files with 14 additions and 3 deletions
|
@ -4,4 +4,8 @@ set -eu
|
|||
|
||||
[ -e /opt/resource/common ] && cd /opt/resource
|
||||
. ./common
|
||||
jq -r --null-input --arg version "$(crane digest "$REPOSITORY:$TAG")" '[{"digest": $version}] | tostring'
|
||||
|
||||
filter='[
|
||||
{"digest": $version}
|
||||
] | tostring'
|
||||
jq -r --null-input --arg version "$(crane digest "$REPOSITORY:$TAG")" "$filter"
|
||||
|
|
5
src/in
5
src/in
|
@ -11,4 +11,7 @@ cd "$oci_dir"
|
|||
tar cf "$1/image.tar" ./*
|
||||
cd - 1>&2 2>/dev/null
|
||||
|
||||
jq -r '.version | tostring' < "$INPUT_FILE"
|
||||
filter='{
|
||||
"version": .version
|
||||
} | tostring'
|
||||
jq -r "$filter" < "$INPUT_FILE"
|
||||
|
|
6
src/out
6
src/out
|
@ -11,4 +11,8 @@ cd "$oci_dir"
|
|||
tar xf "$1/$(jq -r .params.image < "$INPUT_FILE")"
|
||||
cd - 1>&2 2>/dev/null
|
||||
crane push "$oci_dir" "$REPOSITORY:$TAG" --image-refs="$IMAGE_REFS_FILE"
|
||||
jq -r --null-input --arg version "$(sed 's/^[^@]*@//' < "$IMAGE_REFS_FILE")" '{"digest": $version} | tostring'
|
||||
|
||||
filter='{
|
||||
"version": {"digest": $version}
|
||||
} | tostring'
|
||||
jq -r --null-input --arg version "$(sed 's/^[^@]*@//' < "$IMAGE_REFS_FILE")" "$filter"
|
||||
|
|
Reference in a new issue