#!/bin/sh set -eu chart_dir=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd) workdir=$(mktemp -d) trap 'rm -rf "$workdir"' EXIT helm lint "$chart_dir" helm template 30-birthday "$chart_dir" --namespace default \ --set persistence.existingClaim=existing-data \ --set ingress.enabled=true --set ingress.host=test.example \ >"$workdir/rendered.yaml" if grep -q '^kind: PersistentVolumeClaim$' "$workdir/rendered.yaml"; then echo 'existingClaim must not render a PVC' >&2 exit 1 fi grep -q 'claimName: "existing-data"' "$workdir/rendered.yaml" grep -q 'name: 30-birthday-public' "$workdir/rendered.yaml" grep -q 'name: 30-birthday-admin' "$workdir/rendered.yaml" grep -q 'path: /api/admin/' "$workdir/rendered.yaml" app_version=$(sed -n 's/^appVersion: *"\{0,1\}\([^" ]*\).*/\1/p' "$chart_dir/Chart.yaml") image_repository=$(sed -n 's/^ repository: *//p' "$chart_dir/values.yaml") grep -Fq "${image_repository}:${app_version}" "$workdir/rendered.yaml"