From be90fc76c1febb97542923048b7f18a4921ee2b5 Mon Sep 17 00:00:00 2001 From: nabarun Date: Fri, 25 Oct 2024 10:01:22 +0000 Subject: [PATCH] Update script to pay webapp deployer before deployment request (#14) Part of [Service provider auctions for web deployments](https://www.notion.so/Service-provider-auctions-for-web-deployments-104a6b22d47280dbad51d28aa3a91d75) Co-authored-by: Adw8 Reviewed-on: https://git.vdb.to/cerc-io/snowballtools-base/pulls/14 --- packages/deployer/.env.example | 1 + packages/deployer/deploy-frontend.sh | 75 +++++++++++-------- .../application-deployment-request.yml | 19 +++-- .../deployer/records/application-record.yml | 4 +- .../public/.well-known/walletconnect.txt | 1 + packages/gql-client/package.json | 1 + packages/gql-client/src/types.ts | 1 - 7 files changed, 58 insertions(+), 44 deletions(-) create mode 100644 packages/frontend/public/.well-known/walletconnect.txt diff --git a/packages/deployer/.env.example b/packages/deployer/.env.example index 907e9483..732dcfd7 100644 --- a/packages/deployer/.env.example +++ b/packages/deployer/.env.example @@ -1,2 +1,3 @@ REGISTRY_BOND_ID= DEPLOYER_LRN= +AUTHORITY= diff --git a/packages/deployer/deploy-frontend.sh b/packages/deployer/deploy-frontend.sh index c92df03f..6631f274 100755 --- a/packages/deployer/deploy-frontend.sh +++ b/packages/deployer/deploy-frontend.sh @@ -3,6 +3,7 @@ source .env echo "Using REGISTRY_BOND_ID: $REGISTRY_BOND_ID" echo "Using DEPLOYER_LRN: $DEPLOYER_LRN" +echo "Using AUTHORITY: $AUTHORITY" # Repository URL REPO_URL="https://git.vdb.to/cerc-io/snowballtools-base" @@ -21,40 +22,13 @@ CONFIG_FILE=config.yml # Reference: https://git.vdb.to/cerc-io/test-progressive-web-app/src/branch/main/scripts # Get latest version from registry and increment application-record version -NEW_APPLICATION_VERSION=$(yarn --silent laconic -c $CONFIG_FILE registry record list --type ApplicationRecord --all --name "snowballtools-base-frontend" 2>/dev/null | jq -r -s ".[] | sort_by(.createTime) | reverse | [ .[] | select(.bondId == \"$REGISTRY_BOND_ID\") ] | .[0].attributes.version" | awk -F. -v OFS=. '{$NF += 1 ; print}') +NEW_APPLICATION_VERSION=$(yarn --silent laconic -c $CONFIG_FILE registry record list --type ApplicationRecord --all --name "deploy-frontend" 2>/dev/null | jq -r -s ".[] | sort_by(.createTime) | reverse | [ .[] | select(.bondId == \"$REGISTRY_BOND_ID\") ] | .[0].attributes.version" | awk -F. -v OFS=. '{$NF += 1 ; print}') if [ -z "$NEW_APPLICATION_VERSION" ] || [ "1" == "$NEW_APPLICATION_VERSION" ]; then # Set application-record version if no previous records were found NEW_APPLICATION_VERSION=0.0.1 fi -# Generate application-deployment-request.yml -cat >./records/application-deployment-request.yml <./records/application-record.yml <./records/application-deployment-request.yml <