From 2c0f3409033a3feac1c3cfde01a6c418c8deb25e Mon Sep 17 00:00:00 2001 From: Michael Jerger Date: Fri, 10 Mar 2023 15:43:21 +0100 Subject: [PATCH] enable restore parameter --- infrastructure/docker-backup/image/Dockerfile | 2 +- .../docker-backup/image/resources/restore.sh | 14 ++++++++------ 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/infrastructure/docker-backup/image/Dockerfile b/infrastructure/docker-backup/image/Dockerfile index 9b6d4f0..3f3542b 100644 --- a/infrastructure/docker-backup/image/Dockerfile +++ b/infrastructure/docker-backup/image/Dockerfile @@ -1,4 +1,4 @@ -FROM domaindrivenarchitecture/dda-backup:1.0.5 +FROM domaindrivenarchitecture/dda-backup:1.0.7 # Prepare Entrypoint Script ADD resources /tmp diff --git a/infrastructure/docker-backup/image/resources/restore.sh b/infrastructure/docker-backup/image/resources/restore.sh index b536977..07f6725 100755 --- a/infrastructure/docker-backup/image/resources/restore.sh +++ b/infrastructure/docker-backup/image/resources/restore.sh @@ -3,6 +3,10 @@ set -Eeox pipefail function main() { + local role_snapshot_id="${1:-latest}"; shift + local db_snapshot_id="${1:-latest}"; shift + local file_snapshot_id="${1:-latest}"; shift + start-maintenance.sh @@ -15,17 +19,15 @@ function main() { drop-create-db - restore-roles - restore-db - restore-directory '/var/backups/' + restore-roles ${role_snapshot_id} + restore-db ${db_snapshot_id} + restore-directory '/var/backups/' ${file_snapshot_id} end-maintenance.sh - } source /usr/local/lib/functions.sh source /usr/local/lib/pg-functions.sh source /usr/local/lib/file-functions.sh -main - +main "$@"