Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Pass deployer LRN when requesting webapp-deployment #4

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ on:
env:
CERC_REGISTRY_USER_KEY: ${{ secrets.CICD_LACONIC_USER_KEY }}
CERC_REGISTRY_BOND_ID: ${{ secrets.CICD_LACONIC_BOND_ID }}
CERC_REGISTRY_REST_ENDPOINT: ${{ secrets.CICD_LACONIC_REST_ENDPOINT }}
CERC_REGISTRY_GQL_ENDPOINT: ${{ secrets.CICD_LACONIC_GQL_ENDPOINT }}
CERC_DNS: ${{ secrets.CICD_LACONIC_DNS }}
CERC_DEPLOYER_LRN: ${{ secrets.CICD_LACONIC_DEPLOYER_LRN }}

jobs:
cns_publish:
Expand Down
18 changes: 15 additions & 3 deletions scripts/publish-app-record.sh
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,19 @@ 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 bond set ${authority} ${CERC_REGISTRY_BOND_ID} --user-key "${CERC_REGISTRY_USER_KEY}"

echo "Authority: $authority, App: $app"

# Check if the authority is already reserved
whois_response=$(laconic -c $CONFIG_FILE registry authority whois "$authority")

if [ "$(echo "$whois_response" | jq '.[0]')" == "null" ]; then
echo "Authority not reserved. Reserving now..."
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}"
else
echo "Authority '$authority' is already reserved."
fi
fi

laconic -c $CONFIG_FILE registry name set --user-key "${CERC_REGISTRY_USER_KEY}" --bond-id ${CERC_REGISTRY_BOND_ID} "$CERC_REGISTRY_APP_CRN@${rcd_app_version}" "$AR_RECORD_ID"
Expand All @@ -88,8 +99,9 @@ record:
version: 1.0.0
name: "$rcd_name@$rcd_app_version"
application: "$CERC_REGISTRY_APP_CRN@$rcd_app_version"
dns: test.laconic.com
dns: "$CERC_DNS"
deployment: "$CERC_REGISTRY_DEPLOYMENT_CRN"
deployer: "$CERC_DEPLOYER_LRN"
config:
env:
CERC_WEBAPP_DEBUG: "$rcd_app_version"
Expand Down