#!/usr/bin/env bash set -euo pipefail project_dir=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd) kubeconform_image=ghcr.io/yannh/kubeconform:v0.7.0 sh -n "${project_dir}/install.sh" bash -n "${project_dir}/create-ci-kubeconfig.sh" bash -n "${project_dir}/test.sh" validate_file() { local manifest=$1 shift if command -v kubeconform >/dev/null 2>&1; then kubeconform -strict -summary "$@" "${manifest}" elif command -v docker >/dev/null 2>&1; then docker run --rm --interactive "${kubeconform_image}" \ -strict -summary "$@" < "${manifest}" else echo "Required command not found: install kubeconform or Docker" >&2 exit 1 fi } # The standard schema catalog does not contain Traefik's cluster-specific CRDs. validate_file "${project_dir}/anubis.yaml" -ignore-missing-schemas validate_file "${project_dir}/ci-deployer.yaml" grep -Fq 'deployment.brunner.ninja/revision: manual' \ "${project_dir}/anubis.yaml" echo "Anubis scripts and Kubernetes resources are valid."