Files
quay-kubernetes/test.sh
T
feedc0de 8ff1855a7c
Validate and deploy Quay / Validate manifest (push) Successful in 13s
Validate and deploy Quay / Downtime deployment (push) Successful in 34s
Strip sha256 hash
2026-10-14 20:13:18 +02:00

45 lines
1.3 KiB
Bash
Executable File

#!/usr/bin/env bash
set -euo pipefail
project_dir=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)
sh -n "${project_dir}/install.sh"
bash -n "${project_dir}/create-ci-kubeconfig.sh"
bash -n "${project_dir}/test.sh"
mapfile -t quay_images < <(
sed -n 's|^[[:space:]]*image: \(quay.io/projectquay/quay[^[:space:]]*\)$|\1|p' \
"${project_dir}/quay.yaml" | sort --unique
)
if [[ "${#quay_images[@]}" != 1 ]]; then
echo "Both Quay Deployments must use the same single image reference." >&2
exit 1
fi
if [[ "${quay_images[0]}" == *:latest ]]; then
echo "The mutable latest tag is not allowed." >&2
exit 1
fi
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 \
ghcr.io/yannh/kubeconform:v0.7.0 \
-strict -summary "$@" < "${manifest}"
else
echo "Required command not found: install kubeconform or Docker" >&2
exit 1
fi
}
validate_file "${project_dir}/quay.yaml"
validate_file "${project_dir}/ceph-object-user.yaml" -ignore-missing-schemas
validate_file "${project_dir}/ci-deployer.yaml"
echo "Quay scripts and Kubernetes resources are valid for ${quay_images[0]}."