This repository has been archived on 2026-10-18. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
argocd-deployment/test.sh
T

16 lines
886 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
validate() { if command -v kubeconform >/dev/null; then kubeconform -strict -exit-on-error -summary "$@"; else local file=${!#}; podman 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."