Files

26 lines
987 B
Bash
Raw Permalink Normal View History

#!/usr/bin/env bash
set -euo pipefail
project_dir=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)
workdir=$(mktemp --directory)
trap 'rm -rf -- "${workdir}"' EXIT
upstream_commit=$(<"${project_dir}/upstream-commit.txt")
[[ "${upstream_commit}" =~ ^[0-9a-f]{40}$ ]] || {
echo "upstream-commit.txt must contain a full Git commit" >&2
exit 1
}
helm lint "${project_dir}" --strict
package=$("${project_dir}/package.sh" "${workdir}" sha-test)
helm lint "${package}" --strict
helm template brave-sync "${package}" --namespace brave-sync > "${workdir}/rendered.yaml"
test -s "${workdir}/rendered.yaml"
actual_version=$(helm show chart "${package}" | awk '/^version:/ {print $2}')
test "${actual_version}" = "$(<"${project_dir}/chart-version.txt")"
actual_image=$(helm show chart "${package}" | awk '/^appVersion:/ {gsub(/"/, "", $2); print $2}')
test "${actual_image}" = sha-test
2026-10-09 11:43:03 +02:00
grep -Eq 'image:.*:sha-test' "${workdir}/rendered.yaml"
echo "Chart lint, package, and render passed"