Files
feedc0de 9933f9904a
Validate, publish and deploy Gramps Web / validate (push) Failing after 29m16s
Validate, publish and deploy Gramps Web / publish (push) Skipped
Validate, publish and deploy Gramps Web / deploy (push) Skipped
Introduce helm chart and CI and CD
2026-09-06 11:26:19 +02:00

17 lines
487 B
Bash
Executable File

#!/usr/bin/env bash
set -euo pipefail
namespace=${NAMESPACE:-gramps}
pod=${POSTGRES_POD:-postgresql-0}
destination=${1:-"/tmp/gramps-postgresql-$(date +%Y%m%d-%H%M%S).sql.gz"}
umask 077
kubectl --namespace "${namespace}" exec "${pod}" -- bash -ec \
'PGPASSWORD="$(cat "${POSTGRES_PASSWORD_FILE}")" pg_dumpall --username=postgres' \
| gzip -9 > "${destination}"
gzip --test "${destination}"
test -s "${destination}"
echo "PostgreSQL backup written to ${destination} (mode 0600)."