#!/bin/sh

set -eo pipefail

PGPASSWORD='{{ penpot_db_pass }}' /usr/pgsql-15/bin/pg_dump \
  --clean \
  --create \
  --username={{ penpot_db_user | quote }} \
  --host={{ penpot_db_server | quote }} \
  --port={{ penpot_db_port }} \
  {{ penpot_db_name | quote }} | \
  zstd -c > {{ penpot_root_dir }}/backup/{{ penpot_db_name | quote }}.sql.zst
