Skip to content

Commit

Permalink
Revert "dont reserve again"
Browse files Browse the repository at this point in the history
This reverts commit 34782b5.
  • Loading branch information
byoung0589 committed Aug 18, 2024
1 parent 34782b5 commit 077d5f7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 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": "@bargsystems/pwa-test-bargsys",
"name": "@barg-systems/pwa-test-bargsys",
"version": "0.1.26",
"repository": "https://github.com/beezybarg/loro-testnet-example-pwa",
"scripts": {
Expand Down
11 changes: 5 additions & 6 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=greg
CONFIG_FILE=`mktemp`

CERC_APP_TYPE=${CERC_APP_TYPE:-"webapp"}
CERC_REPO_REF=${CERC_REPO_REF:-${GITHUB_SHA:-`git log -1 --format="%H"`}}
Expand All @@ -30,17 +30,16 @@ 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 @@ -58,15 +57,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 077d5f7

Please sign in to comment.