Files
proxmox/scripts/validation/validate-phoenix-deploy-targets.sh
defiQUG b8613905bd
Some checks failed
Deploy to Phoenix / validate (push) Failing after 15s
Deploy to Phoenix / deploy (push) Has been skipped
chore: sync workspace — configs, docs, scripts, CI, pnpm, submodules
- Submodule pins: dbis_core, cross-chain-pmm-lps, mcp-proxmox (local, push may be pending), metamask-integration, smom-dbis-138
- Atomic swap + cross-chain-pmm-lops-publish, deploy-portal workflow, phoenix deploy-targets, routing/aggregator matrices
- Docs, token-lists, forge proxy, phoenix API, runbooks, verify scripts

Made-with: Cursor
2026-04-21 22:01:33 -07:00

49 lines
1.6 KiB
Bash
Executable File

#!/usr/bin/env bash
# Validate phoenix-deploy-api/deploy-targets.json structure.
set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
PROJECT_ROOT="$(cd "$SCRIPT_DIR/../.." && pwd)"
TARGETS_FILE="${1:-$PROJECT_ROOT/phoenix-deploy-api/deploy-targets.json}"
if [[ ! -f "$TARGETS_FILE" ]]; then
echo "[ERROR] Missing deploy targets file: $TARGETS_FILE" >&2
exit 1
fi
if ! command -v jq >/dev/null 2>&1; then
echo "[ERROR] jq is required to validate $TARGETS_FILE" >&2
exit 1
fi
jq -e '
(.targets | type == "array")
and (.targets | length > 0)
and all(.targets[]; (
(.repo | type == "string" and length > 0)
and ((.branch // "main") | type == "string" and length > 0)
and ((.target // "default") | type == "string" and length > 0)
and (.cwd | type == "string" and length > 0)
and (.command | type == "array" and length > 0)
and (all(.command[]; type == "string" and length > 0))
and ((.required_env // []) | type == "array")
and (all((.required_env // [])[]?; type == "string" and length > 0))
and (
(.healthcheck // null) == null or (
(.healthcheck.url | type == "string" and length > 0)
and ((.healthcheck.expect_status // 200) | type == "number")
and ((.healthcheck.attempts // 1) | type == "number")
and ((.healthcheck.delay_ms // 0) | type == "number")
and ((.healthcheck.timeout_ms // 10000) | type == "number")
)
)
))
and (
[.targets[] | [(.repo), (.branch // "main"), (.target // "default")] | join("|")]
| length == (unique | length)
)
' "$TARGETS_FILE" >/dev/null
echo "[OK] phoenix deploy targets valid: $TARGETS_FILE"