Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions DEPLOY_DOC.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,11 +118,11 @@ Then just validate `cdm.json` contains resolved contract metadata and addresses.

## 7. Deploy Frontend

Pending W3S environment support in `bulletin-deploy`. Once `bulletin-deploy --list-environments` includes the W3S/Summit environment, a CDM maintainer can redeploy `contracts.dot`:
The frontend is deployed with [`polkadot-app-deploy`](https://github.com/paritytech/polkadot-app-deploy) (npm: `@parity/polkadot-app-deploy`, the successor of `bulletin-deploy`), which ships the W3S/Summit environment as `summit`. Confirm it appears in `polkadot-app-deploy --list-environments`, then a CDM maintainer can redeploy `contracts.dot`:

```bash
cd ../contract-dependency-manager
BULLETIN_DEPLOY_ENV=w3s src/lib/scripts/deploy-frontend.sh "$CDM_DEPLOY_SURI"
APP_DEPLOY_ENV=summit src/lib/scripts/deploy-frontend.sh "$CDM_DEPLOY_SURI"
```

## Verify
Expand Down
23 changes: 12 additions & 11 deletions src/lib/scripts/deploy-frontend.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,18 @@ set -euo pipefail

usage() {
cat <<'EOF'
Usage: src/lib/scripts/deploy-frontend.sh <suri> [bulletin-deploy args...]
Usage: src/lib/scripts/deploy-frontend.sh <mnemonic> [polkadot-app-deploy args...]

Builds the CDM frontend and deploys it to contracts.dot with bulletin-deploy.
Builds the CDM frontend and deploys it to contracts.dot with polkadot-app-deploy.

Examples:
src/lib/scripts/deploy-frontend.sh '//Alice'
src/lib/scripts/deploy-frontend.sh "$CDM_DEPLOY_SURI"
src/lib/scripts/deploy-frontend.sh "$CDM_DEPLOY_SURI" --tag frontend

Environment:
BULLETIN_DEPLOY_ENV Target bulletin-deploy env. Default: paseo-next-v2
SKIP_BULLETIN_INSTALL Set to 1 to skip npm install -g bulletin-deploy@latest
APP_DEPLOY_ENV Target polkadot-app-deploy env. Default: paseo-next-v2
Run `polkadot-app-deploy --list-environments` for valid ids.
SKIP_APP_DEPLOY_INSTALL Set to 1 to skip npm install -g @parity/polkadot-app-deploy
EOF
}

Expand All @@ -22,28 +23,28 @@ if [[ $# -lt 1 || "${1:-}" == "-h" || "${1:-}" == "--help" ]]; then
exit 1
fi

SURI="$1"
MNEMONIC="$1"
shift

SCRIPT_DIR="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)"
ROOT="$(cd -- "$SCRIPT_DIR/../../.." && pwd)"
FRONTEND_DIST="$ROOT/src/apps/frontend/dist"
DOMAIN="contracts.dot"
ENV_ID="${BULLETIN_DEPLOY_ENV:-paseo-next-v2}"
ENV_ID="${APP_DEPLOY_ENV:-paseo-next-v2}"

cd "$ROOT"

if [[ "${SKIP_BULLETIN_INSTALL:-0}" != "1" ]]; then
npm install -g bulletin-deploy@latest
if [[ "${SKIP_APP_DEPLOY_INSTALL:-0}" != "1" ]]; then
npm install -g @parity/polkadot-app-deploy@latest
fi

pnpm turbo build --filter=@parity/cdm-frontend

export NODE_OPTIONS="${NODE_OPTIONS:+$NODE_OPTIONS }--max-old-space-size=8192"

bulletin-deploy \
polkadot-app-deploy \
--env "$ENV_ID" \
--suri "$SURI" \
--mnemonic "$MNEMONIC" \
"$FRONTEND_DIST" \
"$DOMAIN" \
"$@"
Loading