#!/usr/bin/env bash # # Local convenience: verify the OpenZaak → NRC notification path against a throwaway # oz+nrc stack. Brings both up (notifications enabled), runs the shared stack-agnostic # check (infra/run-notification-check.sh), then always tears down. # # CI does not use this — there the full stack is brought up once and the same runner # is invoked as a step (see the `verify-stack` job / Makefile `verify-*`). See ADR-0007. set -euo pipefail here="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" OZ_COMPOSE="$here/openzaak/docker-compose.yml" NRC_COMPOSE="$here/opennotificaties/docker-compose.yml" cleanup() { docker compose -f "$OZ_COMPOSE" -f "$NRC_COMPOSE" down --volumes >/dev/null 2>&1 || true docker volume rm -f rr-oz-config rr-nrc-config >/dev/null 2>&1 || true } trap cleanup EXIT wait_healthy() { # name-regex local re="$1" cid for _ in $(seq 1 140); do cid="$(docker ps -q --filter "name=$re" | head -1)" if [ -n "$cid" ] && [ "$(docker inspect -f '{{if .State.Health}}{{.State.Health.Status}}{{end}}' "$cid" 2>/dev/null || true)" = healthy ]; then return 0 fi sleep 3 done return 1 } echo ">> bringing up OpenZaak + Open Notificaties (notifications enabled)" bash "$here/seed-config.sh" oz nrc OZ_NOTIFICATIONS_DISABLED=false docker compose -f "$OZ_COMPOSE" -f "$NRC_COMPOSE" up -d echo ">> waiting for OpenZaak + NRC to be healthy" wait_healthy '[-_]openzaak[-_]' || { echo "ERROR: OpenZaak not healthy" >&2; exit 1; } wait_healthy 'nrc-web' || { echo "ERROR: NRC not healthy" >&2; exit 1; } bash "$here/run-notification-check.sh"