This commit is contained in:
Thomas E Lackey 2024-08-20 14:17:44 -05:00
parent 6bc458509b
commit fc8ec497e6
2 changed files with 17 additions and 1 deletions

View File

@ -6,6 +6,9 @@ on:
env: env:
CERC_REGISTRY_USER_KEY: ${{ secrets.CICD_VAASL_LACONIC_USER_KEY }} CERC_REGISTRY_USER_KEY: ${{ secrets.CICD_VAASL_LACONIC_USER_KEY }}
CERC_REGISTRY_BOND_ID: ${{ secrets.CICD_VAASL_LACONIC_BOND_ID }} CERC_REGISTRY_BOND_ID: ${{ secrets.CICD_VAASL_LACONIC_BOND_ID }}
CERC_REGISTRY_DEPLOYMENT_REQUEST_USER_KEY: ${{ secrets.CICD_VAASL_DEPLOYMENT_REQUEST_USER_KEY }}
CERC_REGISTRY_DEPLOYMENT_REQUEST_BOND_ID: ${{ secrets.CICD_VAASL_DEPLOYMENT_REQUEST_BOND_ID }}
CERC_REGISTRY_DEPLOYMENT_REQUEST_PAYMENT_TO: ${{ secrets.CICD_VAASL_DEPLOYMENT_REQUEST_PAYMENT_TO }}
jobs: jobs:
cns_publish: cns_publish:

View File

@ -24,6 +24,13 @@ if [ -z "$CERC_REGISTRY_APP_LRN" ]; then
CERC_REGISTRY_APP_LRN="lrn://$authority/applications/$app" CERC_REGISTRY_APP_LRN="lrn://$authority/applications/$app"
fi fi
PAYMENT_TX=$(laconic -c $CONFIG_FILE registry tokens send \
--address $CERC_REGISTRY_DEPLOYMENT_REQUEST_PAYMENT_TO \
--user-key "${CERC_REGISTRY_DEPLOYMENT_REQUEST_USER_KEY}" \
--bond-id "${CERC_REGISTRY_DEPLOYMENT_REQUEST_BOND_ID}" \
--type alnt \
--quantity ${CERC_REGISTRY_DEPLOYMENT_REQUEST_PAYMENT_AMOUNT:-10000} | jq '.tx.hash')
APP_RECORD=$(laconic -c $CONFIG_FILE registry name resolve "$CERC_REGISTRY_APP_LRN" | jq '.[0]') APP_RECORD=$(laconic -c $CONFIG_FILE registry name resolve "$CERC_REGISTRY_APP_LRN" | jq '.[0]')
if [ -z "$APP_RECORD" ] || [ "null" == "$APP_RECORD" ]; then if [ -z "$APP_RECORD" ] || [ "null" == "$APP_RECORD" ]; then
echo "No record found for $CERC_REGISTRY_APP_LRN." echo "No record found for $CERC_REGISTRY_APP_LRN."
@ -38,6 +45,8 @@ record:
application: "$CERC_REGISTRY_APP_LRN@$rcd_app_version" application: "$CERC_REGISTRY_APP_LRN@$rcd_app_version"
dns: "$CERC_REGISTRY_DEPLOYMENT_HOSTNAME" dns: "$CERC_REGISTRY_DEPLOYMENT_HOSTNAME"
deployment: "$CERC_REGISTRY_DEPLOYMENT_LRN" deployment: "$CERC_REGISTRY_DEPLOYMENT_LRN"
to: $CERC_REGISTRY_DEPLOYMENT_REQUEST_PAYMENT_TO
payment: $PAYMENT_TX
config: config:
env: env:
CERC_WEBAPP_DEBUG: "$rcd_app_version" CERC_WEBAPP_DEBUG: "$rcd_app_version"
@ -47,8 +56,12 @@ record:
repository_ref: "${GITHUB_SHA:-`git log -1 --format="%H"`}" repository_ref: "${GITHUB_SHA:-`git log -1 --format="%H"`}"
EOF EOF
cat $RECORD_FILE cat $RECORD_FILE
RECORD_ID=$(laconic -c $CONFIG_FILE registry 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 registry record publish \
--filename $RECORD_FILE \
--user-key "${CERC_REGISTRY_DEPLOYMENT_REQUEST_USER_KEY}" \
--bond-id ${CERC_REGISTRY_DEPLOYMENT_REQUEST_BOND_ID} | jq -r '.id')
echo $RECORD_ID echo $RECORD_ID
rm -f $RECORD_FILE $CONFIG_FILE rm -f $RECORD_FILE $CONFIG_FILE