feat: add import-gzip-database script

This commit is contained in:
Oliver Davies 2023-04-16 20:54:20 +01:00
parent d9af1a2efd
commit 455cbf3bfc

17
bin/import-gzip-database Executable file
View file

@ -0,0 +1,17 @@
#!/usr/bin/env bash
if [[ "$1" == "" ]]; then
echo "Usage: ${0##*/} <filename>"; exit 2
fi
set -euo pipefail
filename="${1}"
shift 1
pv "${filename}" \
| zcat \
| docker compose exec -T database mysql \
-p"${DB_PASSWORD:-app}" \
-u"${DB_USER:-app}" \
"${DB_NAME:-app}"