Files
quay-kubernetes/test.sh
T
feedc0de ff96903291
Validate and deploy Quay / Validate manifest (push) Successful in 23s
Validate and deploy Quay / Downtime deployment (push) Has been cancelled
Initial commit with existing kubernetes config and CI
2026-08-08 23:57:48 +02:00

43 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"
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
if command -v kubeconform >/dev/null 2>&1; then
kubeconform -strict -ignore-missing-schemas -summary "${manifest}"
elif command -v docker >/dev/null 2>&1; then
docker run --rm --interactive \
ghcr.io/yannh/kubeconform:v0.7.0@sha256:85dbef6b4b312b99133decc9c6fc9495e9fc5f92293d4ff3b7e1b30f5611823c \
-strict -ignore-missing-schemas -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"
validate_file "${project_dir}/ci-deployer.yaml"
echo "Quay scripts and Kubernetes resources are valid for ${quay_images[0]}."