ok
This commit is contained in:
parent
e08b7f4f90
commit
d25472f59d
9
.env
Normal file
9
.env
Normal file
@ -0,0 +1,9 @@
|
||||
NEXT_PUBLIC_LACONIC_GQL_ENDPOINT="https://laconicd-sapo.laconic.com/api"
|
||||
NEXT_PUBLIC_ALWAYS_RANDOM_COORDS=true
|
||||
NEXT_PUBLIC_THEME=forest
|
||||
NEXT_PUBLIC_APP_TITLE="Wildlife Tracker"
|
||||
NEXT_PUBLIC_APP_DESCRIPTION="Document your wildlife encounters"
|
||||
NEXT_PUBLIC_PORTAL_NAME=test-1234
|
||||
|
||||
#can be a csv list
|
||||
#NEXT_PUBLIC_HIDDEN_INDICES=1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32
|
9
.github/workflows/publish-to-laconic.yml
vendored
9
.github/workflows/publish-to-laconic.yml
vendored
@ -15,6 +15,8 @@ env:
|
||||
REGISTRY_DEPLOYMENT_HOSTNAME: ranger-default
|
||||
DEPLOYER_LRN: "lrn://vaasl-provider/deployers/webapp-deployer-api.apps.vaasl.io"
|
||||
AUTHORITY: "vaasl"
|
||||
PINATA_BASE_URL: ${{ secrets.PINATA_BASE_URL }}
|
||||
PINATA_JWT: ${{ secrets.PINATA_JWT }}
|
||||
|
||||
jobs:
|
||||
laconic_publish:
|
||||
@ -28,11 +30,16 @@ jobs:
|
||||
node-version: 18
|
||||
- name: "Enable Yarn"
|
||||
run: corepack enable
|
||||
- name: "Install laconic-so"
|
||||
run: |
|
||||
curl -LO https://git.vdb.to/cerc-io/stack-orchestrator/releases/download/latest/laconic-so
|
||||
chmod +x ./laconic-so
|
||||
mv ./laconic-so /usr/bin/laconic-so
|
||||
- name: "Install registry CLI"
|
||||
run: |
|
||||
npm config set @cerc-io:registry https://git.vdb.to/api/packages/cerc-io/npm/
|
||||
npm install -g @cerc-io/laconic-registry-cli
|
||||
- name: "Install jq"
|
||||
run: sudo apt -y update && sudo apt -y install jq
|
||||
run: sudo apt -y update && sudo apt -y install jq gpg
|
||||
- name: "Publish Application Record"
|
||||
run: scripts/deploy-frontend.sh
|
||||
|
@ -68,50 +68,25 @@ if [ "true" == "$CERC_IS_LATEST_RELEASE" ]; then
|
||||
laconic -c $CONFIG_FILE registry name set --user-key "${REGISTRY_USER_KEY}" --bond-id ${REGISTRY_BOND_ID} "$REGISTRY_APP_LRN" "$RECORD_ID"
|
||||
fi
|
||||
|
||||
rcd_name=$(jq -r '.name' package.json | sed 's/null//' | sed 's/^@//')
|
||||
rcd_app_version=$(jq -r '.version' package.json | sed 's/null//')
|
||||
rm -f $CONFIG_FILE
|
||||
|
||||
|
||||
# Get payment address for deployer
|
||||
paymentAddress=$(laconic -c $CONFIG_FILE registry name resolve "$DEPLOYER_LRN" | jq -r '.[0].attributes.paymentAddress')
|
||||
paymentAmount=$(laconic -c $CONFIG_FILE registry name resolve "$DEPLOYER_LRN" | jq -r '.[0].attributes.minimumPayment' | sed 's/alnt//g')
|
||||
# Pay deployer if paymentAmount is not null
|
||||
if [[ -n "$paymentAmount" && "$paymentAmount" != "null" ]]; then
|
||||
payment=$(laconic -c $CONFIG_FILE registry tokens send --address "$paymentAddress" --type alnt --quantity "$paymentAmount" --user-key "$REGISTRY_USER_KEY" --bond-id "$REGISTRY_BOND_ID")
|
||||
|
||||
# Extract the transaction hash
|
||||
txHash=$(echo "$payment" | jq -r '.tx.hash')
|
||||
echo "Paid deployer with txHash as $txHash"
|
||||
|
||||
else
|
||||
echo "Payment amount is null; skipping payment."
|
||||
fi
|
||||
|
||||
# Generate application-deployment-request.yml
|
||||
cat <<EOF | sed '/.*: ""$/d' > "$RECORD_FILE"
|
||||
record:
|
||||
type: ApplicationDeploymentRequest
|
||||
version: '1.0.0'
|
||||
name: "$rcd_name@$rcd_app_version"
|
||||
application: "$REGISTRY_APP_LRN@$rcd_app_version"
|
||||
deployer: $DEPLOYER_LRN
|
||||
dns: $REGISTRY_DEPLOYMENT_HOSTNAME
|
||||
config:
|
||||
env:
|
||||
LACONIC_HOSTED_CONFIG_laconicd_chain_id: laconic-testnet-2
|
||||
meta:
|
||||
note: "Added by CI @ `date`"
|
||||
repository: "`git remote get-url origin`"
|
||||
repository_ref: "${GITHUB_SHA:-`git log -1 --format="%H"`}"
|
||||
payment: $txHash
|
||||
cat <<EOF > "$CONFIG_FILE"
|
||||
services:
|
||||
registry:
|
||||
rpcEndpoint: '${REGISTRY_RPC_ENDPOINT:-http://testnet-a-1.dev.vaasl.io:26657}'
|
||||
gqlEndpoint: '${REGISTRY_GQL_ENDPOINT:-http://testnet-a-1.dev.vaasl.io:9473/api}'
|
||||
userKey: ${REGISTRY_USER_KEY}
|
||||
bondId: ${REGISTRY_BOND_ID}
|
||||
chainId: ${REGISTRY_CHAIN_ID:-laconic-08062024}
|
||||
gas: 900000
|
||||
fees: 900000alnt
|
||||
EOF
|
||||
|
||||
## make .env
|
||||
|
||||
cat $RECORD_FILE
|
||||
RECORD_ID=$(laconic -c $CONFIG_FILE registry record publish \
|
||||
--filename $RECORD_FILE \
|
||||
--user-key "${REGISTRY_USER_KEY}" \
|
||||
--bond-id ${REGISTRY_BOND_ID} | jq -r '.id')
|
||||
echo $RECORD_ID
|
||||
cat .env
|
||||
|
||||
rm -f $RECORD_FILE $CONFIG_FILE
|
||||
echo "PINATA_JWT=$PINATA_JWT" >> .env
|
||||
echo "PINATA_BASE_URL=$PINATA_BASE_URL" >> .env
|
||||
|
||||
laconic-so request-webapp-deployment --laconic-config $CONFIG_FILE --deployer $DEPLOYER_LRN --app $REGISTRY_APP_LRN --env-file .env --dns ranger-test --make-payment auto
|
||||
|
Loading…
Reference in New Issue
Block a user