Files
feedc0de af6196d4a9
Validate, publish and promote Asciinema chart / validate (push) Successful in 15s
Validate, publish and promote Asciinema chart / publish (push) Successful in 28s
Support external PostgreSQL deployments
2026-10-25 11:35:37 +01:00

31 lines
1.4 KiB
Bash
Executable File

#!/usr/bin/env bash
set -euo pipefail
project_dir=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)
chart="$project_dir/chart/asciinema"
bash -n "$project_dir/test.sh" "$project_dir/scripts/chart-version.sh"
helm lint "$chart"
helm template asciinema "$chart" --namespace asciinema --values "$project_dir/examples/values.yaml" > /tmp/asciinema-rendered.yaml
grep -Fq 'name: data' /tmp/asciinema-rendered.yaml
grep -Fq 'name: asciinema-secrets' /tmp/asciinema-rendered.yaml
grep -Fq 'kind: StatefulSet' /tmp/asciinema-rendered.yaml
grep -Fq 'kind: Ingress' /tmp/asciinema-rendered.yaml
helm template asciinema "$chart" --namespace asciinema \
--values "$project_dir/examples/values.yaml" --set postgresql.enabled=false \
> /tmp/asciinema-external-postgresql-rendered.yaml
if grep -Eq '^kind: (StatefulSet|PersistentVolumeClaim)$' /tmp/asciinema-external-postgresql-rendered.yaml; then
echo 'PostgreSQL resources must be omitted when postgresql.enabled=false.' >&2
exit 1
fi
if command -v kubeconform >/dev/null 2>&1; then
kubeconform -strict -summary /tmp/asciinema-rendered.yaml
elif command -v docker >/dev/null 2>&1 && docker info >/dev/null 2>&1; then
docker run --rm --interactive ghcr.io/yannh/kubeconform:v0.7.0 -strict -summary < /tmp/asciinema-rendered.yaml
else
echo 'Skipping kubeconform; neither kubeconform nor a running Docker daemon is available.'
fi