Validate, publish, and deploy Brave Sync / validate (push) Successful in 13s
Validate, publish, and deploy Brave Sync / image (push) Failing after 5s
Validate, publish, and deploy Brave Sync / chart (push) Skipped
Validate, publish, and deploy Brave Sync / deploy (push) Skipped
26 lines
987 B
Bash
Executable File
26 lines
987 B
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
|
|
|
|
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
|
|
grep -Eq 'image:.*:sha-test' "${workdir}/rendered.yaml"
|
|
|
|
echo "Chart lint, package, and render passed"
|