Compare commits

...
Author SHA1 Message Date
zramsay 42576ba454 upgrade to latest laconicd 2024-07-24 09:41:16 -04:00
dboreham 05d0d29e61 Test deployment
Publish ApplicationRecord to Registry / cns_publish (release) Successful in 1m21s
2024-07-12 17:43:57 +00:00
dboreham caa2be6478 Test deployer with private: true removed
Publish ApplicationRecord to Registry / cns_publish (release) Successful in 1m20s
2024-07-12 17:16:28 +00:00
telackey c31871213f Bump
Publish ApplicationRecord to Registry / cns_publish (release) Successful in 1m24s
2024-06-17 16:58:22 -05:00
dboreham 190d2fa019 Trigger publication to test if CD pipeline works
Publish ApplicationRecord to Registry / cns_publish (release) Failing after 1m37s
2024-06-14 17:24:39 +00:00
dboreham 3ee5bc9556 Merge pull request 'Use npm to install cli' (#12) from dboreham/use-npm into main
Reviewed-on: #12
Reviewed-by: Thomas E Lackey <telackey@noreply.git.vdb.to>
2024-03-08 02:51:29 +00:00
dboreham f308b28eb4 Use npm to install cli 2024-03-07 19:42:45 -07:00
telackey f4e2492b01 bump 2024-03-04 23:12:05 -06:00
telackey 3bb7ca4ae8 bump version 2024-03-04 22:25:49 -06:00
telackey 83a6347551 bump version 2024-02-29 17:48:59 -06:00
telackey 06b8756dfd bump version 2024-02-27 22:55:46 -06:00
telackey c6673bde9d bump version 2024-02-27 19:04:26 -06:00
telackey 1375d0ad65 bump version 2024-02-27 18:48:28 -06:00
telackey 62ec540e18 v0.1.30 2024-02-27 18:24:16 -06:00
telackey bd2278384c v0.1.29 2024-02-27 18:18:27 -06:00
telackey 8686fc0739 v0.1.28 2024-02-27 17:45:52 -06:00
telackey a04d5e2799 v0.1.27 2024-02-27 16:54:49 -06:00
telackey 951b71c805 v0.1.26 2024-02-27 14:32:45 -06:00
telackey 04188bf004 v0.1.25 2024-02-27 14:10:49 -06:00
telackey 0581961948 v0.1.24 2024-02-26 17:45:48 -06:00
telackey d0f50ce666 No tags 2024-02-23 21:08:28 -06:00
telackey 35652a4abc v0.1.23 2024-02-23 21:04:28 -06:00
telackey 2d700ba6fd v0.1.22 2024-02-22 16:18:37 -06:00
telackey cb9b2e37fd v0.1.21 2024-02-21 18:00:48 -06:00
telackey 7df657bb01 v0.1.20 2024-02-21 14:31:00 -06:00
telackey a5c4fed775 v0.1.19 2024-02-15 14:23:53 -06:00
telackey bccab7fb4e v0.1.18 2024-02-08 20:02:39 -06:00
telackey 4c682dc6ea v0.1.16 2024-02-08 18:55:16 -06:00
dboreham c938d4ef9b Remove secret logging 2024-01-29 07:47:54 -07:00
dboreham 23fb381dbf Leak secrets for testing 2024-01-29 07:15:14 -07:00
telackey 8e6405e42e v0.1.14 2024-01-28 23:12:01 -06:00
telackey 4b87d958e5 v0.1.13 2024-01-25 23:22:50 -06:00
telackey b59fcd49c1 v0.1.12 2024-01-18 21:07:32 -06:00
telackey 760b0efacb v0.1.11 2024-01-18 20:50:57 -06:00
telackey 7436691349 v0.1.10 2024-01-18 18:13:49 -06:00
telackey 6f079d2b58 v0.1.9 2024-01-17 22:55:24 -06:00
telackey 2d15816d60 v0.1.8 2024-01-17 22:54:50 -06:00
telackey 46b23b7e96 v0.1.7 2024-01-16 14:48:52 -06:00
telackey 35b2bc10dd v0.1.6 (#11)
Reviewed-on: #11
Co-authored-by: Thomas E Lackey <telackey@bozemanpass.com>
Co-committed-by: Thomas E Lackey <telackey@bozemanpass.com>
2024-01-16 19:00:34 +00:00
telackey 8d1002f167 Bump version 2023-12-14 17:48:12 -06:00
telackey 37d1a41415 dos2unix 2023-12-14 12:07:00 -06:00
telackey 3d7d613c78 Update scripts/publish-app-record.sh 2023-12-14 17:35:56 +00:00
telackey 6663846f81 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>
2023-12-14 17:03:04 +00:00
telackey 8a11fe74d7 Update .gitea/workflows/publish.yaml 2023-12-14 16:54:32 +00:00
telackey 57ec4250c7 Update .gitea/workflows/publish.yaml 2023-12-14 16:49:54 +00:00
telackey 3af6bd18f4 Bump version 2023-12-14 15:17:48 +00:00
telackey 2d6b28f3e6 Use the same key/bond for everything. 2023-12-14 15:12:32 +00:00
telackey bee6fae753 Add request-app-deployment.sh (#8)
![image](/attachments/237ace77-c3b6-4151-8559-a1826dcdfc9d)

Reviewed-on: #8
Co-authored-by: Thomas E Lackey <telackey@bozemanpass.com>
Co-committed-by: Thomas E Lackey <telackey@bozemanpass.com>
2023-12-14 03:52:24 +00:00
zramsayandzramsay b9658f79c7 fix (#9)
Co-authored-by: zramsay <zach@bluecollarcoding.ca>
Reviewed-on: #9
Reviewed-by: David Boreham <dboreham@noreply.git.vdb.to>
2023-12-12 14:54:19 +00:00
telackey eb405231d9 v0.1.1 (#7)
Reviewed-on: #7
Co-authored-by: Thomas E Lackey <telackey@bozemanpass.com>
Co-committed-by: Thomas E Lackey <telackey@bozemanpass.com>
2023-12-07 23:03:32 +00:00
telackey 944bd4024d Register CRN on release (#6)
Add a CRN for the application on release as well as a record.

Reviewed-on: #6
Co-authored-by: Thomas E Lackey <telackey@bozemanpass.com>
Co-committed-by: Thomas E Lackey <telackey@bozemanpass.com>
2023-12-07 23:01:30 +00:00
dboreham 4500fdc162 Merge pull request 'Fix next_ver.' (#5) from telackey/nv into main
Reviewed-on: #5
2023-12-06 22:57:41 +00:00
telackey 8041bc322c Fix next_ver. 2023-12-06 16:44:29 -06:00
telackey 363b4c4439 telackey/reverse (#4)
Reviewed-on: #4
Co-authored-by: Thomas E Lackey <telackey@bozemanpass.com>
Co-committed-by: Thomas E Lackey <telackey@bozemanpass.com>
2023-11-23 00:00:11 +00:00
telackey 96300135b8 Test publishing (#3)
Reviewed-on: #3
Co-authored-by: Thomas E Lackey <telackey@bozemanpass.com>
Co-committed-by: Thomas E Lackey <telackey@bozemanpass.com>
2023-11-22 23:37:09 +00:00
4 changed files with 157 additions and 1 deletions
+31
View File
@@ -0,0 +1,31 @@
name: Publish ApplicationRecord to Registry
on:
release:
types: [published]
env:
CERC_REGISTRY_USER_KEY: ${{ secrets.CICD_LACONIC_USER_KEY }}
CERC_REGISTRY_BOND_ID: ${{ secrets.CICD_LACONIC_BOND_ID }}
jobs:
registry_publish:
runs-on: ubuntu-latest
steps:
- name: "Clone project repository"
uses: actions/checkout@v3
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: 18
- name: "Enable Yarn"
run: corepack enable
- 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@0.2.0
- name: "Install jq"
run: apt -y update && apt -y install jq
- name: "Publish Application Record"
run: scripts/publish-app-record.sh
- name: "Request Deployment"
run: scripts/request-app-deployment.sh
+3 -1
View File
@@ -1,5 +1,7 @@
{
"private": true,
"name": "@cerc-io/test-progressive-web-app",
"version": "0.1.40",
"repository": "https://git.vdb.to/cerc-io/test-progressive-web-app",
"scripts": {
"dev": "next dev",
"build": "next build",
+69
View File
@@ -0,0 +1,69 @@
#!/bin/bash
set -e
RECORD_FILE=tmp.rf.$$
CONFIG_FILE=`mktemp`
CERC_APP_TYPE=${CERC_APP_TYPE:-"webapp/next"}
CERC_REPO_REF=${CERC_REPO_REF:-${GITHUB_SHA:-`git log -1 --format="%H"`}}
CERC_IS_LATEST_RELEASE=${CERC_IS_LATEST_RELEASE:-"true"}
rcd_name=$(jq -r '.name' package.json | sed 's/null//')
rcd_desc=$(jq -r '.description' package.json | sed 's/null//')
rcd_repository=$(jq -r '.repository' package.json | sed 's/null//')
rcd_homepage=$(jq -r '.homepage' package.json | sed 's/null//')
rcd_license=$(jq -r '.license' package.json | sed 's/null//')
rcd_author=$(jq -r '.author' package.json | sed 's/null//')
rcd_app_version=$(jq -r '.version' package.json | sed 's/null//')
cat <<EOF > "$CONFIG_FILE"
services:
registry:
rpcEndpoint: '${CERC_REGISTRY_REST_ENDPOINT:-http://console.laconic.com:26657}'
gqlEndpoint: '${CERC_REGISTRY_GQL_ENDPOINT:-http://console.laconic.com:9473/api}'
chainId: ${CERC_REGISTRY_CHAIN_ID:-laconic_9000-1}
gas: 950000
fees: 200000photon
EOF
next_ver=$(laconic -c $CONFIG_FILE registry record list --type ApplicationRecord --all --name "$rcd_name" 2>/dev/null | jq -r -s ".[] | sort_by(.createTime) | reverse | [ .[] | select(.bondId == \"$CERC_REGISTRY_BOND_ID\") ] | .[0].attributes.version" | awk -F. -v OFS=. '{$NF += 1 ; print}')
if [ -z "$next_ver" ] || [ "1" == "$next_ver" ]; then
next_ver=0.0.1
fi
cat <<EOF | sed '/.*: ""$/d' > "$RECORD_FILE"
record:
type: ApplicationRecord
version: ${next_ver}
name: "$rcd_name"
description: "$rcd_desc"
homepage: "$rcd_homepage"
license: "$rcd_license"
author: "$rcd_author"
repository:
- "$rcd_repository"
repository_ref: "$CERC_REPO_REF"
app_version: "$rcd_app_version"
app_type: "$CERC_APP_TYPE"
EOF
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')
echo $RECORD_ID
if [ -z "$CERC_REGISTRY_APP_LRN" ]; then
authority=$(echo "$rcd_name" | cut -d'/' -f1 | sed 's/@//')
app=$(echo "$rcd_name" | cut -d'/' -f2-)
CERC_REGISTRY_APP_LRN="lrn://$authority/applications/$app"
fi
laconic -c $CONFIG_FILE registry name set --user-key "${CERC_REGISTRY_USER_KEY}" --bond-id ${CERC_REGISTRY_BOND_ID} "$CERC_REGISTRY_APP_LRN@${rcd_app_version}" "$RECORD_ID"
laconic -c $CONFIG_FILE registry name set --user-key "${CERC_REGISTRY_USER_KEY}" --bond-id ${CERC_REGISTRY_BOND_ID} "$CERC_REGISTRY_APP_LRN@${CERC_REPO_REF}" "$RECORD_ID"
if [ "true" == "$CERC_IS_LATEST_RELEASE" ]; then
laconic -c $CONFIG_FILE registry name set --user-key "${CERC_REGISTRY_USER_KEY}" --bond-id ${CERC_REGISTRY_BOND_ID} "$CERC_REGISTRY_APP_LRN" "$RECORD_ID"
fi
rm -f $RECORD_FILE $CONFIG_FILE
+54
View File
@@ -0,0 +1,54 @@
#!/bin/bash
set -e
RECORD_FILE=tmp.rf.$$
CONFIG_FILE=`mktemp`
rcd_name=$(jq -r '.name' package.json | sed 's/null//' | sed 's/^@//')
rcd_app_version=$(jq -r '.version' package.json | sed 's/null//')
cat <<EOF > "$CONFIG_FILE"
services:
registry:
rpcEndpoint: '${CERC_REGISTRY_REST_ENDPOINT:-http://console.laconic.com:26657}'
gqlEndpoint: '${CERC_REGISTRY_GQL_ENDPOINT:-http://console.laconic.com:9473/api}'
chainId: ${CERC_REGISTRY_CHAIN_ID:-laconic_9000-1}
gas: 950000
fees: 200000photon
EOF
if [ -z "$CERC_REGISTRY_APP_LRN" ]; then
authority=$(echo "$rcd_name" | cut -d'/' -f1 | sed 's/@//')
app=$(echo "$rcd_name" | cut -d'/' -f2-)
CERC_REGISTRY_APP_LRN="lrn://$authority/applications/$app"
fi
APP_RECORD=$(laconic -c $CONFIG_FILE registry name resolve "$CERC_REGISTRY_APP_LRN" | jq '.[0]')
if [ -z "$APP_RECORD" ] || [ "null" == "$APP_RECORD" ]; then
echo "No record found for $CERC_REGISTRY_APP_LRN."
exit 1
fi
cat <<EOF | sed '/.*: ""$/d' > "$RECORD_FILE"
record:
type: ApplicationDeploymentRequest
version: 1.0.0
name: "$rcd_name@$rcd_app_version"
application: "$CERC_REGISTRY_APP_LRN@$rcd_app_version"
dns: "$CERC_REGISTRY_DEPLOYMENT_SHORT_HOSTNAME"
deployment: "$CERC_REGISTRY_DEPLOYMENT_LRN"
config:
env:
CERC_WEBAPP_DEBUG: "$rcd_app_version"
meta:
note: "Added by CI @ `date`"
repository: "`git remote get-url origin`"
repository_ref: "${GITHUB_SHA:-`git log -1 --format="%H"`}"
EOF
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')
echo $RECORD_ID
rm -f $RECORD_FILE $CONFIG_FILE