Generate the CRN (#10)

Reviewed-on: #10
Co-authored-by: Thomas E Lackey <telackey@bozemanpass.com>
Co-committed-by: Thomas E Lackey <telackey@bozemanpass.com>
This commit is contained in:
Thomas E Lackey 2023-12-14 17:03:04 +00:00 committed by Thomas E Lackey
parent 8a11fe74d7
commit 6663846f81
3 changed files with 15 additions and 10 deletions

View File

@ -1,7 +1,7 @@
{ {
"private": true, "private": true,
"name": "@cerc-io/test-progressive-web-app", "name": "@cerc-io/test-progressive-web-app",
"version": "0.1.3", "version": "0.1.4",
"repository": "https://git.vdb.to/cerc-io/test-progressive-web-app", "repository": "https://git.vdb.to/cerc-io/test-progressive-web-app",
"scripts": { "scripts": {
"dev": "next dev", "dev": "next dev",

View File

@ -54,13 +54,17 @@ cat $RECORD_FILE
RECORD_ID=$(laconic -c $CONFIG_FILE cns record publish --filename $RECORD_FILE --user-key "${CERC_REGISTRY_USER_KEY}" --bond-id ${CERC_REGISTRY_BOND_ID} | jq -r '.id') RECORD_ID=$(laconic -c $CONFIG_FILE cns record publish --filename $RECORD_FILE --user-key "${CERC_REGISTRY_USER_KEY}" --bond-id ${CERC_REGISTRY_BOND_ID} | jq -r '.id')
echo $RECORD_ID echo $RECORD_ID
if [ -n "$CERC_REGISTRY_APP_CRN" ]; then if [ -z "$CERC_REGISTRY_APP_CRN" ]; then
laconic -c $CONFIG_FILE cns name set --user-key "${CERC_REGISTRY_USER_KEY}" --bond-id ${CERC_REGISTRY_BOND_ID} "$CERC_REGISTRY_APP_CRN@${rcd_app_version}" "$RECORD_ID" authority=$(echo "$rcd_name" | cut -d'/' -f1 | sed 's/@//')
laconic -c $CONFIG_FILE cns name set --user-key "${CERC_REGISTRY_USER_KEY}" --bond-id ${CERC_REGISTRY_BOND_ID} "$CERC_REGISTRY_APP_CRN@${CERC_REPO_REF}" "$RECORD_ID" app=$(echo "$rcd_name" | cut -d'/' -f2-)
if [ "true" == "$CERC_IS_LATEST_RELEASE" ]; then CERC_REGISTRY_APP_CRN="crn://$authority/applications/$app"
laconic -c $CONFIG_FILE cns name set --user-key "${CERC_REGISTRY_USER_KEY}" --bond-id ${CERC_REGISTRY_BOND_ID} "$CERC_REGISTRY_APP_CRN" "$RECORD_ID" fi
laconic -c $CONFIG_FILE cns name set --user-key "${CERC_REGISTRY_USER_KEY}" --bond-id ${CERC_REGISTRY_BOND_ID} "$CERC_REGISTRY_APP_CRN@latest" "$RECORD_ID"
fi laconic -c $CONFIG_FILE cns name set --user-key "${CERC_REGISTRY_USER_KEY}" --bond-id ${CERC_REGISTRY_BOND_ID} "$CERC_REGISTRY_APP_CRN@${rcd_app_version}" "$RECORD_ID"
laconic -c $CONFIG_FILE cns name set --user-key "${CERC_REGISTRY_USER_KEY}" --bond-id ${CERC_REGISTRY_BOND_ID} "$CERC_REGISTRY_APP_CRN@${CERC_REPO_REF}" "$RECORD_ID"
if [ "true" == "$CERC_IS_LATEST_RELEASE" ]; then
laconic -c $CONFIG_FILE cns name set --user-key "${CERC_REGISTRY_USER_KEY}" --bond-id ${CERC_REGISTRY_BOND_ID} "$CERC_REGISTRY_APP_CRN" "$RECORD_ID"
laconic -c $CONFIG_FILE cns name set --user-key "${CERC_REGISTRY_USER_KEY}" --bond-id ${CERC_REGISTRY_BOND_ID} "$CERC_REGISTRY_APP_CRN@latest" "$RECORD_ID"
fi fi
rm -f $RECORD_FILE $CONFIG_FILE rm -f $RECORD_FILE $CONFIG_FILE

View File

@ -19,8 +19,9 @@ services:
EOF EOF
if [ -z "$CERC_REGISTRY_APP_CRN" ]; then if [ -z "$CERC_REGISTRY_APP_CRN" ]; then
echo "CERC_REGISTRY_APP_CRN is required." 1>&2 authority=$(echo "$rcd_name" | cut -d'/' -f1 | sed 's/@//')
exit 1 app=$(echo "$rcd_name" | cut -d'/' -f2-)
CERC_REGISTRY_APP_CRN="crn://$authority/applications/$app"
fi fi
APP_RECORD=$(laconic -c $CONFIG_FILE cns name resolve "$CERC_REGISTRY_APP_CRN" | jq '.[0]') APP_RECORD=$(laconic -c $CONFIG_FILE cns name resolve "$CERC_REGISTRY_APP_CRN" | jq '.[0]')