feat(deploy): nightly database backups with verified restore (M7)
A backup container dumps the database every night, keeps 14 daily and 8 weekly copies and once a week restores a copy into a scratch database to check tables and row counts. update.sh takes a copy before updating, restore.sh brings one back and keeps the old database aside. CI runs the dump, verify and restore cycle on the database the end-to-end journey filled. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
d91ff89c64
commit
aacf55679a
7 files changed
+250
-3
No files matched your search
@@ -53,6 +53,12 @@ if [ -n "$cur_core" ] && [ -n "$tgt_core" ] && [ "$cur_core" != "$tgt_core" ] &&
|
||||
fi
|
||||
fi
|
||||
|
||||
# Копия базы перед обновлением: миграции назад не откатываются (deploy/restore.sh — вернуть).
|
||||
if [ -n "$(docker compose ps -q --status running postgres 2>/dev/null)" ]; then
|
||||
echo "→ резервная копия базы"
|
||||
docker compose run --rm --no-deps backup once >/dev/null
|
||||
fi
|
||||
|
||||
echo "→ переключаемся на $REF"
|
||||
if git show-ref --verify --quiet "refs/remotes/origin/$REF"; then
|
||||
git checkout --quiet "$REF"
|
||||
|
||||
Reference in new issue
Block a user