#!/usr/bin/env bash
set -euo pipefail

printf "Planned deployment order (no actions performed):\n\n"
cat <<ORDER
1) Core
   - stacks/core/traefik.yml
   - stacks/databases/postgresql-primary.yml
   - stacks/databases/mariadb-primary.yml
   - stacks/databases/redis-cluster.yml

2) Monitoring
   - stacks/monitoring/netdata.yml

3) Apps (wave 1)
   - stacks/apps/homeassistant.yml
   - stacks/apps/immich.yml
   - stacks/apps/nextcloud.yml
   - stacks/apps/paperless.yml
   - stacks/apps/jellyfin.yml

4) Apps (wave 2)
   - stacks/apps/gitea.yml
   - stacks/apps/appflowy.yml
   - stacks/apps/vaultwarden.yml
   - stacks/apps/adguard.yml

5) Native/web
   - stacks/web/caddy.yml
   - stacks/ai/ollama.yml

Safety:
- Use blue/green: keep legacy running until switchover verified.
- DB: prefer replication options documented in WORLD_CLASS_MIGRATION_TODO.md.
- DNS: lower TTL 48h before each cutover.
ORDER
