Skip to content

Commit

Permalink
dont reserve again
Browse files Browse the repository at this point in the history
  • Loading branch information
byoung0589 committed Aug 17, 2024
1 parent 07422be commit 34782b5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"private": true,
"name": "@barg-systems/pwa-test-bargsys",
"name": "@bargsystems/pwa-test-bargsys",
"version": "0.1.26",
"repository": "https://github.com/beezybarg/loro-testnet-example-pwa",
"scripts": {
Expand Down
11 changes: 6 additions & 5 deletions scripts/publish-app-record.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ set -e

AR_RECORD_FILE=tmp.rf.$$
ADR_RECORD_FILE=tmp.rf.$$
CONFIG_FILE=`mktemp`
CONFIG_FILE=greg

CERC_APP_TYPE=${CERC_APP_TYPE:-"webapp"}
CERC_REPO_REF=${CERC_REPO_REF:-${GITHUB_SHA:-`git log -1 --format="%H"`}}
Expand All @@ -30,16 +30,17 @@ EOF

if [ -z "$CERC_REGISTRY_BOND_ID" ]; then
bond_id=$(laconic -c $CONFIG_FILE registry bond create --type alnt --quantity 100000000 --user-key "${CERC_REGISTRY_USER_KEY}")

echo ${bond_id}
CERC_REGISTRY_BOND_ID=$(echo ${bond_id} | jq -r .bondId)
fi

next_ver=$(laconic -c $CONFIG_FILE registry record list --type ApplicationRecord --all --name "$rcd_name" 2>/dev/null | jq -r -s ".[] | sort_by(.createTime) | reverse | [ .[] | select(.bondId == \"$CERC_REGISTRY_BOND_ID\") ] | .[0].attributes.version" | awk -F. -v OFS=. '{$NF += 1 ; print}')

echo nextver $next_ver
if [ -z "$next_ver" ] || [ "1" == "$next_ver" ]; then
next_ver=0.0.1
fi

echo "creating AR record file"
cat <<EOF | sed '/.*: ""$/d' > "$AR_RECORD_FILE"
record:
type: ApplicationRecord
Expand All @@ -57,15 +58,15 @@ record:
EOF


cat $AR_RECORD_FILE
cat "$AR_RECORD_FILE"
AR_RECORD_ID=$(laconic -c $CONFIG_FILE registry record publish --filename $AR_RECORD_FILE --user-key "${CERC_REGISTRY_USER_KEY}" --bond-id ${CERC_REGISTRY_BOND_ID} | jq -r '.id')
echo $AR_RECORD_ID

if [ -z "$CERC_REGISTRY_APP_CRN" ]; then
authority=$(echo "$rcd_name" | cut -d'/' -f1 | sed 's/@//')
app=$(echo "$rcd_name" | cut -d'/' -f2-)
CERC_REGISTRY_APP_CRN="lrn://$authority/applications/$app"
laconic -c $CONFIG_FILE registry authority reserve ${authority} --user-key "${CERC_REGISTRY_USER_KEY}"
# laconic -c $CONFIG_FILE registry authority reserve ${authority} --user-key "${CERC_REGISTRY_USER_KEY}"
laconic -c $CONFIG_FILE registry authority bond set ${authority} ${CERC_REGISTRY_BOND_ID} --user-key "${CERC_REGISTRY_USER_KEY}"
fi

Expand Down

0 comments on commit 34782b5

Please sign in to comment.