Files
traefik-error-pages/test.sh
T
feedc0de 4a68a78f0a
Validate and deploy error pages / Validate manifests (push) Failing after 25s
Validate and deploy error pages / Deploy to Kubernetes (push) Has been skipped
Initial commit
2026-08-08 20:42:38 +02:00

40 lines
1.2 KiB
Bash
Executable File

#!/usr/bin/env bash
set -euo pipefail
project_dir=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)
workdir=$(mktemp --directory)
trap 'rm -rf "${workdir}"' EXIT
if (( $# > 0 )); then
values_files=("$@")
else
values_files=(values.yaml values-brunner-ninja.yaml)
fi
for values_file in "${values_files[@]}"; do
case "${values_file}" in
/*) values_path="${values_file}" ;;
*) values_path="${project_dir}/${values_file}" ;;
esac
output="${workdir}/$(basename "${values_file}")"
helm lint "${project_dir}" --values "${values_path}"
helm template traefik-error-pages "${project_dir}" \
--namespace default \
--values "${values_path}" > "${output}"
test -s "${output}"
done
if [[ -f "${workdir}/values-brunner-ninja.yaml" ]]; then
grep --quiet 'brunner\.ninja Reverse Proxy' "${workdir}/values-brunner-ninja.yaml"
grep --quiet '^ name: authentik$' "${workdir}/values-brunner-ninja.yaml"
fi
if [[ -f "${workdir}/values.yaml" ]]; then
if grep --quiet '^ name: error-auth$' "${workdir}/values.yaml"; then
echo "Generic values unexpectedly enabled the authentication middleware" >&2
exit 1
fi
fi
echo "All requested configurations rendered successfully"