mirror of
https://github.com/edgelesssys/constellation.git
synced 2025-02-23 16:30:11 -05:00
split jq command into multiple lines
This commit is contained in:
parent
8bc12b0887
commit
df04e7b9cb
@ -54,12 +54,38 @@ jobs:
|
||||
# This jq filter selects the measurements for the correct CSP and attestation variant
|
||||
# and then removes all `warnOnly: true` and `expected: 000...` measurements.
|
||||
jq --arg attestation_variant "$attestationVariant" --arg csp "$csp" \
|
||||
'.list.[] | select(.attestationVariant == $attestation_variant) | select((.csp | ascii_downcase) == $csp) | .measurements | walk(if (type=="object" and (.warnOnly or .expected == "0000000000000000000000000000000000000000000000000000000000000000")) then del(.) else . end) | del(..|nulls) | del(.[] .warnOnly)' \
|
||||
'
|
||||
.list.[]
|
||||
| select(
|
||||
.attestationVariant == $attestation_variant
|
||||
)
|
||||
| select((.csp | ascii_downcase) == $csp)
|
||||
| .measurements
|
||||
| walk(
|
||||
if (
|
||||
type=="object" and (
|
||||
.warnOnly or .expected == "0000000000000000000000000000000000000000000000000000000000000000"
|
||||
)
|
||||
)
|
||||
then del(.) else . end
|
||||
)
|
||||
| del(..|nulls)
|
||||
| del(.[] .warnOnly)
|
||||
' \
|
||||
measurements.json > their-measurements.json
|
||||
|
||||
sudo env "PATH=$PATH" "$buildPath/measured-boot/cmd/cmd_/cmd" "$directory/constellation" ./own-measurements.json
|
||||
# Remove all `expected: 000...` measurements like above.
|
||||
jq '.measurements | walk(if (type == "object" and .expected == "0000000000000000000000000000000000000000000000000000000000000000") then del(.) else . end) | del(..|nulls)' \
|
||||
jq '
|
||||
.measurements
|
||||
| walk(
|
||||
if (
|
||||
type == "object" and .expected == "0000000000000000000000000000000000000000000000000000000000000000"
|
||||
)
|
||||
then del(.) else . end
|
||||
)
|
||||
| del(..|nulls)
|
||||
' \
|
||||
own-measurements.json | sponge ./own-measurements.json
|
||||
|
||||
echo "Their measurements:"
|
||||
|
Loading…
x
Reference in New Issue
Block a user