Compare commits
21 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| c77c17608f | |||
| 60a9a35e31 | |||
| 065357a1f9 | |||
| d8654ee02d | |||
| 0b489b7797 | |||
| 2844bc06cb | |||
| 19a867a6aa | |||
| 9c795ec4d2 | |||
| 4e8b4de017 | |||
| 3cece29758 | |||
| 1b04cfa554 | |||
| ad43624925 | |||
| 8d8676bde7 | |||
| 630d08f506 | |||
| b03cc94e5e | |||
| 9978d84d16 | |||
| d5af00327f | |||
| 30e84c7733 | |||
| e9e606a33a | |||
| 6a0711aba7 | |||
| a2d5028661 |
@@ -1 +1 @@
|
||||
export PG_BACKUP_CONFIG_VERSION=v1
|
||||
export PG_BACKUP_CONFIG_VERSION=v2
|
||||
|
||||
+14
-3
@@ -2,21 +2,32 @@ if [ "$1" == "pre-backup" ]; then
|
||||
# Remove any existing db dump and then create a new one
|
||||
rm -rf $DATA_DIR/postgres/postgres-backup
|
||||
source /baserow/data/.pgpass
|
||||
PGPASSWORD=$DATABASE_PASSWORD pg_dump -j 8 -h localhost -U baserow baserow --format=directory -f $DATA_DIR/postgres/postgres-backup
|
||||
PGPASSWORD=$DATABASE_PASSWORD pg_dump -j 2 -h localhost -U baserow baserow --format=directory -f $DATA_DIR/postgres/postgres-backup
|
||||
exit
|
||||
fi
|
||||
|
||||
if [ "$1" == "post-backup" ]; then
|
||||
rm -rf $DATA_DIR/postgres/postgres-backup
|
||||
# rm -rf $DATA_DIR/postgres/postgres-backup
|
||||
exit
|
||||
fi
|
||||
|
||||
if [ "$1" == "pre-restore" ]; then
|
||||
pkill -STOP -f "webfrontend"
|
||||
pkill -STOP -f "celery"
|
||||
pkill -STOP -f "caddy"
|
||||
|
||||
# Disconnect any remaining idle sessions from the 'baserow' database
|
||||
# This prevents "database is being accessed by other users" errors during pg_restore -c
|
||||
source /baserow/data/.pgpass
|
||||
PGPASSWORD=$DATABASE_PASSWORD psql -h localhost -U baserow -d postgres -c "SELECT pg_terminate_backend(pid) FROM pg_stat_activity WHERE datname = 'baserow' AND pid <> pg_backend_pid();"
|
||||
exit
|
||||
fi
|
||||
|
||||
if [ "$1" == "post-restore" ]; then
|
||||
source /baserow/data/.pgpass
|
||||
PGPASSWORD=$DATABASE_PASSWORD pg_restore -j 8 -h localhost -U baserow -d baserow -c $DATA_DIR/postgres/postgres-backup
|
||||
PGPASSWORD=$DATABASE_PASSWORD pg_restore -j 2 -h localhost -U baserow -d baserow -c $DATA_DIR/postgres/postgres-backup
|
||||
pkill -CONT -f "webfrontend"
|
||||
pkill -CONT -f "celery"
|
||||
pkill -CONT -f "caddy"
|
||||
exit
|
||||
fi
|
||||
+3
-3
@@ -3,7 +3,7 @@ version: "3.8"
|
||||
|
||||
services:
|
||||
app:
|
||||
image: baserow/baserow:2.2.2
|
||||
image: baserow/baserow:2.3.3
|
||||
networks:
|
||||
- proxy
|
||||
environment:
|
||||
@@ -33,7 +33,7 @@ services:
|
||||
- "backupbot.backup.pre-hook=/backup.sh pre-backup"
|
||||
- "backupbot.backup.post-hook=/backup.sh post-backup"
|
||||
- "backupbot.restore.post-hook=/backup.sh post-restore"
|
||||
- "coop-cloud.${STACK_NAME}.version=2.0.1+2.2.2"
|
||||
- "coop-cloud.${STACK_NAME}.version=2.3.3+2.3.3"
|
||||
healthcheck:
|
||||
test: ["CMD", "./baserow.sh", "backend-cmd", "backend-healthcheck"]
|
||||
interval: 30s
|
||||
@@ -52,7 +52,7 @@ volumes:
|
||||
|
||||
configs:
|
||||
backup-postgres:
|
||||
name: backup-postgres_${PG_BACKUP_CONFIG_VERSION}
|
||||
name: ${STACK_NAME}_backup-postgres_${PG_BACKUP_CONFIG_VERSION}
|
||||
file: ./backup-postgres.sh
|
||||
|
||||
networks:
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
|
||||
"extends": [
|
||||
"config:recommended"
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user