Package mobymask-v2 stack web-apps similar to laconic-console app (#310)

* Build MobyMask web-app at container build step

* Fix web-app start script to use env variables in config

* Replace variables in built web-app files

* Use published mobymask-ui package from gitea

* Use published react-peer/test-app from gitea

* Remove local gitea publish TODO

Former-commit-id: cf79f0de0a
This commit is contained in:
2023-04-18 18:25:58 +05:30
committed by GitHub
parent cb72e5c03f
commit b0aeff50bb
16 changed files with 210 additions and 57 deletions
@@ -1,7 +0,0 @@
{
"name": "MobyMask",
"relayNodes": [],
"peer": {
"enableDebugInfo": true
}
}
@@ -1,4 +1,4 @@
#!/bin/sh
#!/usr/bin/env bash
set -e
if [ -n "$CERC_SCRIPT_DEBUG" ]; then
set -x
@@ -28,13 +28,10 @@ else
echo "Taking deployed contract details from env"
fi
# Export config values in a json file
jq --arg address "$CERC_DEPLOYED_CONTRACT" \
--argjson chainId "$CERC_CHAIN_ID" \
--argjson relayNodes "$CERC_RELAY_NODES" \
'.address = $address | .chainId = $chainId | .relayNodes = $relayNodes' \
/app/src/mobymask-app-config.json > /app/src/config.json
# Use yq to create config.yml with environment variables
yq -n ".address = env(CERC_DEPLOYED_CONTRACT)" > /config/config.yml
yq ".watcherUrl = env(CERC_APP_WATCHER_URL)" -i /config/config.yml
yq ".chainId = env(CERC_CHAIN_ID)" -i /config/config.yml
yq ".relayNodes = strenv(CERC_RELAY_NODES)" -i /config/config.yml
REACT_APP_WATCHER_URI="$CERC_APP_WATCHER_URL/graphql" npm run build
serve -s build
/scripts/start-serving-app.sh
@@ -14,11 +14,7 @@ fi
echo "Using CERC_RELAY_NODES $CERC_RELAY_NODES"
# Set relay nodes in config using CERC_RELAY_NODES
jq --argjson relayNodes "$CERC_RELAY_NODES" \
'.relayNodes = $relayNodes' \
./src/test-app-config.json > ./src/config.json
# Use yq to create config.yml with environment variables
yq -n ".relayNodes = strenv(CERC_RELAY_NODES)" > /config/config.yml
yarn build
serve -s build
/scripts/start-serving-app.sh