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 "$@"