#!/usr/bin/env bash # Generates ArgoCD Application manifests (one per app folder) + an AppProject. # # Layout produced: # argocd/apps/project.yaml -> AppProject "k3s-cluster" (sync-wave -1) # argocd/apps/.yaml -> Application for that app folder # argocd-bootstrap.yaml (repo root) -> app-of-apps: syncs everything in argocd/apps/ # # Bootstrap (one-time, after ArgoCD + cert-manager are installed): # kubectl apply -f argocd-bootstrap.yaml # # Re-run this script after adding/removing an app folder to regenerate the manifests. set -euo pipefail cd "$(dirname "$0")/.." # repo root REPO="${REPO:-https://git.rogi.casa/roger/k3s-cluster.git}" REV="${REV:-main}" APPS_DIR="argocd/apps" mkdir -p "$APPS_DIR" # app-name | namespace | path | recurse | validate APPS=( "argocd|argocd|argocd|false|true" "cert-manager|cert-manager|cert-manager|true|true" "fava|fava|fava|true|true" "gitea|gitea|gitea|true|true" "glance|glance|glance|true|true" "gym-tracker|gym-tracker|gym-tracker|true|true" "homeassistant|home-assistant|homeassistant|true|true" "jellyfin|jellyfin|jellyfin|true|true" "litellm|litellm|litellm|true|true" "minecraft-server|minecraft|minecraft-server|true|true" "monitoring|monitoring|monitoring|true|true" "myorg-assistant|myorg-assistant|myorg-assistant|true|true" "n8n|n8n|n8n|true|true" "nas|nas-proxy|nas|true|true" "openwebui|openwebui|openwebui|true|true" "phoenix|phoenix|phoenix|true|false" "pihole|pihole|pihole|true|true" "platform-engineer|platform-engineer|platform-engineer|true|true" "qbittorrent|qbittorrent|qbittorrent|true|true" "vaultwarden|vaultwarden|vaultwarden|true|true" ) # --------------------------------------------------------------------------- # AppProject # --------------------------------------------------------------------------- cat > "$APPS_DIR/project.yaml" < "$APPS_DIR/${name}.yaml" < argocd-bootstrap.yaml <