1
0

Compare commits

..

35 Commits

Author SHA1 Message Date
d0f50ce666 No tags 2024-02-23 21:08:28 -06:00
35652a4abc v0.1.23 2024-02-23 21:04:28 -06:00
2d700ba6fd v0.1.22 2024-02-22 16:18:37 -06:00
cb9b2e37fd v0.1.21 2024-02-21 18:00:48 -06:00
7df657bb01 v0.1.20 2024-02-21 14:31:00 -06:00
a5c4fed775 v0.1.19 2024-02-15 14:23:53 -06:00
bccab7fb4e v0.1.18 2024-02-08 20:02:39 -06:00
4c682dc6ea v0.1.16 2024-02-08 18:55:16 -06:00
c938d4ef9b Remove secret logging 2024-01-29 07:47:54 -07:00
23fb381dbf Leak secrets for testing 2024-01-29 07:15:14 -07:00
8e6405e42e v0.1.14 2024-01-28 23:12:01 -06:00
4b87d958e5 v0.1.13 2024-01-25 23:22:50 -06:00
b59fcd49c1 v0.1.12 2024-01-18 21:07:32 -06:00
760b0efacb v0.1.11 2024-01-18 20:50:57 -06:00
7436691349 v0.1.10 2024-01-18 18:13:49 -06:00
6f079d2b58 v0.1.9 2024-01-17 22:55:24 -06:00
2d15816d60 v0.1.8 2024-01-17 22:54:50 -06:00
46b23b7e96 v0.1.7 2024-01-16 14:48:52 -06:00
35b2bc10dd v0.1.6 (#11)
Reviewed-on: cerc-io/test-progressive-web-app#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
8d1002f167 Bump version 2023-12-14 17:48:12 -06:00
37d1a41415 dos2unix 2023-12-14 12:07:00 -06:00
3d7d613c78 Update scripts/publish-app-record.sh 2023-12-14 17:35:56 +00:00
6663846f81 Generate the CRN (#10)
Reviewed-on: cerc-io/test-progressive-web-app#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
8a11fe74d7 Update .gitea/workflows/publish.yaml 2023-12-14 16:54:32 +00:00
57ec4250c7 Update .gitea/workflows/publish.yaml 2023-12-14 16:49:54 +00:00
3af6bd18f4 Bump version 2023-12-14 15:17:48 +00:00
2d6b28f3e6 Use the same key/bond for everything. 2023-12-14 15:12:32 +00:00
bee6fae753 Add request-app-deployment.sh (#8)
![image](/attachments/237ace77-c3b6-4151-8559-a1826dcdfc9d)

Reviewed-on: cerc-io/test-progressive-web-app#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
b9658f79c7 fix (#9)
Co-authored-by: zramsay <zach@bluecollarcoding.ca>
Reviewed-on: cerc-io/test-progressive-web-app#9
Reviewed-by: David Boreham <dboreham@noreply.git.vdb.to>
2023-12-12 14:54:19 +00:00
eb405231d9 v0.1.1 (#7)
Reviewed-on: cerc-io/test-progressive-web-app#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
944bd4024d Register CRN on release (#6)
Add a CRN for the application on release as well as a record.

Reviewed-on: cerc-io/test-progressive-web-app#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
4500fdc162 Merge pull request 'Fix next_ver.' (#5) from telackey/nv into main
Reviewed-on: cerc-io/test-progressive-web-app#5
2023-12-06 22:57:41 +00:00
8041bc322c Fix next_ver. 2023-12-06 16:44:29 -06:00
363b4c4439 telackey/reverse (#4)
Reviewed-on: cerc-io/test-progressive-web-app#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
96300135b8 Test publishing (#3)
Reviewed-on: cerc-io/test-progressive-web-app#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
6 changed files with 206 additions and 54 deletions

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:
cns_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: "Install Yarn"
run: npm install -g yarn
- name: "Install registry CLI"
run: |
npm config set @cerc-io:registry https://git.vdb.to/api/packages/cerc-io/npm/
yarn global add @cerc-io/laconic-registry-cli
- 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

View File

@ -9,7 +9,4 @@ module.exports = withPWA({
CERC_TEST_WEBAPP_CONFIG2: process.env.CERC_TEST_WEBAPP_CONFIG2,
CERC_WEBAPP_DEBUG: process.env.CERC_WEBAPP_DEBUG,
},
experimental: {
staticWorkerRequestDeduping: true,
}
})

94
package-lock.json generated
View File

@ -5,7 +5,7 @@
"packages": {
"": {
"dependencies": {
"next": "^14.0.2",
"next": "latest",
"next-pwa": "^5.6.0",
"react": "^18.2.0",
"react-dom": "^18.2.0"
@ -1613,14 +1613,14 @@
}
},
"node_modules/@next/env": {
"version": "14.0.2",
"resolved": "https://registry.npmjs.org/@next/env/-/env-14.0.2.tgz",
"integrity": "sha512-HAW1sljizEaduEOes/m84oUqeIDAUYBR1CDwu2tobNlNDFP3cSm9d6QsOsGeNlIppU1p/p1+bWbYCbvwjFiceA=="
"version": "14.0.1",
"resolved": "https://registry.npmjs.org/@next/env/-/env-14.0.1.tgz",
"integrity": "sha512-Ms8ZswqY65/YfcjrlcIwMPD7Rg/dVjdLapMcSHG26W6O67EJDF435ShW4H4LXi1xKO1oRc97tLXUpx8jpLe86A=="
},
"node_modules/@next/swc-darwin-arm64": {
"version": "14.0.2",
"resolved": "https://registry.npmjs.org/@next/swc-darwin-arm64/-/swc-darwin-arm64-14.0.2.tgz",
"integrity": "sha512-i+jQY0fOb8L5gvGvojWyZMfQoQtDVB2kYe7fufOEiST6sicvzI2W5/EXo4lX5bLUjapHKe+nFxuVv7BA+Pd7LQ==",
"version": "14.0.1",
"resolved": "https://registry.npmjs.org/@next/swc-darwin-arm64/-/swc-darwin-arm64-14.0.1.tgz",
"integrity": "sha512-JyxnGCS4qT67hdOKQ0CkgFTp+PXub5W1wsGvIq98TNbF3YEIN7iDekYhYsZzc8Ov0pWEsghQt+tANdidITCLaw==",
"cpu": [
"arm64"
],
@ -1633,9 +1633,9 @@
}
},
"node_modules/@next/swc-darwin-x64": {
"version": "14.0.2",
"resolved": "https://registry.npmjs.org/@next/swc-darwin-x64/-/swc-darwin-x64-14.0.2.tgz",
"integrity": "sha512-zRCAO0d2hW6gBEa4wJaLn+gY8qtIqD3gYd9NjruuN98OCI6YyelmhWVVLlREjS7RYrm9OUQIp/iVJFeB6kP1hg==",
"version": "14.0.1",
"resolved": "https://registry.npmjs.org/@next/swc-darwin-x64/-/swc-darwin-x64-14.0.1.tgz",
"integrity": "sha512-625Z7bb5AyIzswF9hvfZWa+HTwFZw+Jn3lOBNZB87lUS0iuCYDHqk3ujuHCkiyPtSC0xFBtYDLcrZ11mF/ap3w==",
"cpu": [
"x64"
],
@ -1648,9 +1648,9 @@
}
},
"node_modules/@next/swc-linux-arm64-gnu": {
"version": "14.0.2",
"resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-14.0.2.tgz",
"integrity": "sha512-tSJmiaon8YaKsVhi7GgRizZoV0N1Sx5+i+hFTrCKKQN7s3tuqW0Rov+RYdPhAv/pJl4qiG+XfSX4eJXqpNg3dA==",
"version": "14.0.1",
"resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-14.0.1.tgz",
"integrity": "sha512-iVpn3KG3DprFXzVHM09kvb//4CNNXBQ9NB/pTm8LO+vnnnaObnzFdS5KM+w1okwa32xH0g8EvZIhoB3fI3mS1g==",
"cpu": [
"arm64"
],
@ -1663,9 +1663,9 @@
}
},
"node_modules/@next/swc-linux-arm64-musl": {
"version": "14.0.2",
"resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-14.0.2.tgz",
"integrity": "sha512-dXJLMSEOwqJKcag1BeX1C+ekdPPJ9yXbWIt3nAadhbLx5CjACoB2NQj9Xcqu2tmdr5L6m34fR+fjGPs+ZVPLzA==",
"version": "14.0.1",
"resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-14.0.1.tgz",
"integrity": "sha512-mVsGyMxTLWZXyD5sen6kGOTYVOO67lZjLApIj/JsTEEohDDt1im2nkspzfV5MvhfS7diDw6Rp/xvAQaWZTv1Ww==",
"cpu": [
"arm64"
],
@ -1678,9 +1678,9 @@
}
},
"node_modules/@next/swc-linux-x64-gnu": {
"version": "14.0.2",
"resolved": "https://registry.npmjs.org/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-14.0.2.tgz",
"integrity": "sha512-WC9KAPSowj6as76P3vf1J3mf2QTm3Wv3FBzQi7UJ+dxWjK3MhHVWsWUo24AnmHx9qDcEtHM58okgZkXVqeLB+Q==",
"version": "14.0.1",
"resolved": "https://registry.npmjs.org/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-14.0.1.tgz",
"integrity": "sha512-wMqf90uDWN001NqCM/auRl3+qVVeKfjJdT9XW+RMIOf+rhUzadmYJu++tp2y+hUbb6GTRhT+VjQzcgg/QTD9NQ==",
"cpu": [
"x64"
],
@ -1693,9 +1693,9 @@
}
},
"node_modules/@next/swc-linux-x64-musl": {
"version": "14.0.2",
"resolved": "https://registry.npmjs.org/@next/swc-linux-x64-musl/-/swc-linux-x64-musl-14.0.2.tgz",
"integrity": "sha512-KSSAwvUcjtdZY4zJFa2f5VNJIwuEVnOSlqYqbQIawREJA+gUI6egeiRu290pXioQXnQHYYdXmnVNZ4M+VMB7KQ==",
"version": "14.0.1",
"resolved": "https://registry.npmjs.org/@next/swc-linux-x64-musl/-/swc-linux-x64-musl-14.0.1.tgz",
"integrity": "sha512-ol1X1e24w4j4QwdeNjfX0f+Nza25n+ymY0T2frTyalVczUmzkVD7QGgPTZMHfR1aLrO69hBs0G3QBYaj22J5GQ==",
"cpu": [
"x64"
],
@ -1708,9 +1708,9 @@
}
},
"node_modules/@next/swc-win32-arm64-msvc": {
"version": "14.0.2",
"resolved": "https://registry.npmjs.org/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-14.0.2.tgz",
"integrity": "sha512-2/O0F1SqJ0bD3zqNuYge0ok7OEWCQwk55RPheDYD0va5ij7kYwrFkq5ycCRN0TLjLfxSF6xI5NM6nC5ux7svEQ==",
"version": "14.0.1",
"resolved": "https://registry.npmjs.org/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-14.0.1.tgz",
"integrity": "sha512-WEmTEeWs6yRUEnUlahTgvZteh5RJc4sEjCQIodJlZZ5/VJwVP8p2L7l6VhzQhT4h7KvLx/Ed4UViBdne6zpIsw==",
"cpu": [
"arm64"
],
@ -1723,9 +1723,9 @@
}
},
"node_modules/@next/swc-win32-ia32-msvc": {
"version": "14.0.2",
"resolved": "https://registry.npmjs.org/@next/swc-win32-ia32-msvc/-/swc-win32-ia32-msvc-14.0.2.tgz",
"integrity": "sha512-vJI/x70Id0oN4Bq/R6byBqV1/NS5Dl31zC+lowO8SDu1fHmUxoAdILZR5X/sKbiJpuvKcCrwbYgJU8FF/Gh50Q==",
"version": "14.0.1",
"resolved": "https://registry.npmjs.org/@next/swc-win32-ia32-msvc/-/swc-win32-ia32-msvc-14.0.1.tgz",
"integrity": "sha512-oFpHphN4ygAgZUKjzga7SoH2VGbEJXZa/KL8bHCAwCjDWle6R1SpiGOdUdA8EJ9YsG1TYWpzY6FTbUA+iAJeww==",
"cpu": [
"ia32"
],
@ -1738,9 +1738,9 @@
}
},
"node_modules/@next/swc-win32-x64-msvc": {
"version": "14.0.2",
"resolved": "https://registry.npmjs.org/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-14.0.2.tgz",
"integrity": "sha512-Ut4LXIUvC5m8pHTe2j0vq/YDnTEyq6RSR9vHYPqnELrDapPhLNz9Od/L5Ow3J8RNDWpEnfCiQXuVdfjlNEJ7ug==",
"version": "14.0.1",
"resolved": "https://registry.npmjs.org/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-14.0.1.tgz",
"integrity": "sha512-FFp3nOJ/5qSpeWT0BZQ+YE1pSMk4IMpkME/1DwKBwhg4mJLB9L+6EXuJi4JEwaJdl5iN+UUlmUD3IsR1kx5fAg==",
"cpu": [
"x64"
],
@ -3886,9 +3886,9 @@
"integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w=="
},
"node_modules/nanoid": {
"version": "3.3.7",
"resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.7.tgz",
"integrity": "sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==",
"version": "3.3.6",
"resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.6.tgz",
"integrity": "sha512-BGcqMMJuToF7i1rt+2PWSNVnWIkGCU78jBG3RxO/bZlnZPK2Cmi2QaffxGO/2RvWi9sL+FAiRiXMgsyxQ1DIDA==",
"funding": [
{
"type": "github",
@ -3909,11 +3909,11 @@
"peer": true
},
"node_modules/next": {
"version": "14.0.2",
"resolved": "https://registry.npmjs.org/next/-/next-14.0.2.tgz",
"integrity": "sha512-jsAU2CkYS40GaQYOiLl9m93RTv2DA/tTJ0NRlmZIBIL87YwQ/xR8k796z7IqgM3jydI8G25dXvyYMC9VDIevIg==",
"version": "14.0.1",
"resolved": "https://registry.npmjs.org/next/-/next-14.0.1.tgz",
"integrity": "sha512-s4YaLpE4b0gmb3ggtmpmV+wt+lPRuGtANzojMQ2+gmBpgX9w5fTbjsy6dXByBuENsdCX5pukZH/GxdFgO62+pA==",
"dependencies": {
"@next/env": "14.0.2",
"@next/env": "14.0.1",
"@swc/helpers": "0.5.2",
"busboy": "1.6.0",
"caniuse-lite": "^1.0.30001406",
@ -3928,15 +3928,15 @@
"node": ">=18.17.0"
},
"optionalDependencies": {
"@next/swc-darwin-arm64": "14.0.2",
"@next/swc-darwin-x64": "14.0.2",
"@next/swc-linux-arm64-gnu": "14.0.2",
"@next/swc-linux-arm64-musl": "14.0.2",
"@next/swc-linux-x64-gnu": "14.0.2",
"@next/swc-linux-x64-musl": "14.0.2",
"@next/swc-win32-arm64-msvc": "14.0.2",
"@next/swc-win32-ia32-msvc": "14.0.2",
"@next/swc-win32-x64-msvc": "14.0.2"
"@next/swc-darwin-arm64": "14.0.1",
"@next/swc-darwin-x64": "14.0.1",
"@next/swc-linux-arm64-gnu": "14.0.1",
"@next/swc-linux-arm64-musl": "14.0.1",
"@next/swc-linux-x64-gnu": "14.0.1",
"@next/swc-linux-x64-musl": "14.0.1",
"@next/swc-win32-arm64-msvc": "14.0.1",
"@next/swc-win32-ia32-msvc": "14.0.1",
"@next/swc-win32-x64-msvc": "14.0.1"
},
"peerDependencies": {
"@opentelemetry/api": "^1.1.0",

View File

@ -1,14 +1,15 @@
{
"private": true,
"name": "@cerc-io/test-progressive-web-app",
"version": "0.1.23",
"repository": "https://git.vdb.to/cerc-io/test-progressive-web-app",
"scripts": {
"dev": "next dev",
"build": "next build",
"start": "next start",
"compile": "next experimental-compile",
"generate": "next experimental-generate"
"start": "next start"
},
"dependencies": {
"next": "^14.0.2",
"next": "latest",
"next-pwa": "^5.6.0",
"react": "^18.2.0",
"react-dom": "^18.2.0"

69
scripts/publish-app-record.sh Executable file
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:
cns:
restEndpoint: '${CERC_REGISTRY_REST_ENDPOINT:-http://console.laconic.com:1317}'
gqlEndpoint: '${CERC_REGISTRY_GQL_ENDPOINT:-http://console.laconic.com:9473/api}'
chainId: ${CERC_REGISTRY_CHAIN_ID:-laconic_9000-1}
gas: 950000
fees: 200000aphoton
EOF
next_ver=$(laconic -c $CONFIG_FILE cns 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 cns 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_CRN" ]; then
authority=$(echo "$rcd_name" | cut -d'/' -f1 | sed 's/@//')
app=$(echo "$rcd_name" | cut -d'/' -f2-)
CERC_REGISTRY_APP_CRN="crn://$authority/applications/$app"
fi
laconic -c $CONFIG_FILE cns name set --user-key "${CERC_REGISTRY_USER_KEY}" --bond-id ${CERC_REGISTRY_BOND_ID} "$CERC_REGISTRY_APP_CRN@${rcd_app_version}" "$RECORD_ID"
laconic -c $CONFIG_FILE cns name set --user-key "${CERC_REGISTRY_USER_KEY}" --bond-id ${CERC_REGISTRY_BOND_ID} "$CERC_REGISTRY_APP_CRN@${CERC_REPO_REF}" "$RECORD_ID"
if [ "true" == "$CERC_IS_LATEST_RELEASE" ]; then
laconic -c $CONFIG_FILE cns name set --user-key "${CERC_REGISTRY_USER_KEY}" --bond-id ${CERC_REGISTRY_BOND_ID} "$CERC_REGISTRY_APP_CRN" "$RECORD_ID"
fi
rm -f $RECORD_FILE $CONFIG_FILE

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:
cns:
restEndpoint: '${CERC_REGISTRY_REST_ENDPOINT:-http://console.laconic.com:1317}'
gqlEndpoint: '${CERC_REGISTRY_GQL_ENDPOINT:-http://console.laconic.com:9473/api}'
chainId: ${CERC_REGISTRY_CHAIN_ID:-laconic_9000-1}
gas: 950000
fees: 200000aphoton
EOF
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="crn://$authority/applications/$app"
fi
APP_RECORD=$(laconic -c $CONFIG_FILE cns name resolve "$CERC_REGISTRY_APP_CRN" | jq '.[0]')
if [ -z "$APP_RECORD" ] || [ "null" == "$APP_RECORD" ]; then
echo "No record found for $CERC_REGISTRY_APP_CRN."
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_CRN@$rcd_app_version"
dns: "$CERC_REGISTRY_DEPLOYMENT_SHORT_HOSTNAME"
deployment: "$CERC_REGISTRY_DEPLOYMENT_CRN"
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 cns 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