Filter by bond ID

This commit is contained in:
Thomas E Lackey 2023-11-22 17:58:03 -06:00
parent 6da833aaab
commit c99a2ccdea

View File

@ -26,7 +26,7 @@ services:
fees: 200000aphoton
EOF
next_ver=$(laconic -c $CONFIG_FILE cns record list --type ApplicationRecord --all --name "$rcd_name" 2>/dev/null | jq -s '.[] | sort_by(.createTime) | reverse' | jq -r '.[0].attributes.version' | awk -F. -v OFS=. '{$NF += 1 ; print}')
next_ver=$(laconic -c $CONFIG_FILE cns record list --type ApplicationRecord --all --name "$rcd_name" 2>/dev/null | jq -r -s ".[] | sort_by(.createTime) | reverse | [ .[] | select(.bondId == \"$CERC_LACONIC_BOND_ID\") ] | .[0].attributes.version" | awk -F. -v OFS=. '{$NF += 1 ; print}')
cat <<EOF | sed '/.*: ""$/d' > "$RECORD_FILE"
record:
@ -45,6 +45,6 @@ EOF
cat $RECORD_FILE
laconic -c $CONFIG_FILE cns record publish --filename $RECORD_FILE --user-key "${CERC_LACONIC_USER_KEY:-$CICD_LACONIC_USER_KEY}" --bond-id ${CERC_LACONIC_BOND_ID:-$CICD_LACONIC_BOND_ID}
laconic -c $CONFIG_FILE cns record publish --filename $RECORD_FILE --user-key "${CERC_LACONIC_USER_KEY}" --bond-id ${CERC_LACONIC_BOND_ID}
rm -f $RECORD_FILE $CONFIG_FILE