33 lines
914 B
Bash
Executable File
33 lines
914 B
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
|
|
|
|
sh -n "${project_dir}/install.sh"
|
|
bash -n "${project_dir}/create-ci-kubeconfig.sh"
|
|
bash -n "${project_dir}/test.sh"
|
|
|
|
grep -Fq 'METALLB_VERSION=v0.16.0' "${project_dir}/install.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
|
|
}
|
|
|
|
validate_file "${project_dir}/metallb.yaml" -ignore-missing-schemas
|
|
validate_file "${project_dir}/ci-deployer.yaml"
|
|
|
|
echo "MetalLB scripts and site-specific resources are valid."
|