16 lines
958 B
Bash
Executable File
16 lines
958 B
Bash
Executable File
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
project_dir=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)
|
|
workdir=$(mktemp -d); trap 'rm -rf "${workdir}"' EXIT
|
|
sh -n "${project_dir}/install.sh"
|
|
bash -n "${project_dir}/render.sh" "${project_dir}/create-ci-kubeconfig.sh" "${project_dir}/test.sh"
|
|
"${project_dir}/render.sh" "${workdir}/argocd.yaml"
|
|
if grep -Eq '^kind: Secret$' "${workdir}/argocd.yaml"; then
|
|
echo "Rendered Argo CD state must not contain Secrets" >&2; exit 1
|
|
fi
|
|
image=ghcr.io/yannh/kubeconform:v0.7.0@sha256:85dbef6b4b312b99133decc9c6fc9495e9fc5f92293d4ff3b7e1b30f5611823c
|
|
validate() { if command -v kubeconform >/dev/null; then kubeconform -strict -exit-on-error -summary "$@"; else local file=${!#}; docker run --rm -i "${image}" -strict -exit-on-error -summary "${@:1:$#-1}" < "$file"; fi; }
|
|
validate -ignore-missing-schemas "${workdir}/argocd.yaml"
|
|
validate "${project_dir}/ci-deployer.yaml"
|
|
echo "Argo CD chart and CI resources are valid."
|