35 lines
1.1 KiB
Bash
Executable File
35 lines
1.1 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
set -euo pipefail
|
|
|
|
project_dir=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)
|
|
kubeconform_image=ghcr.io/yannh/kubeconform:v0.7.0@sha256:85dbef6b4b312b99133decc9c6fc9495e9fc5f92293d4ff3b7e1b30f5611823c
|
|
|
|
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."
|