Mercurial > public > ssdt-docker
diff scripts/restore-document-store.sh @ 533:2e67cfae1533 production v2.17.0
flow: Merged <release> '2.17.0' to <master> ('production').
author | Marc Davis <marc.davis@mcoecn.org> |
---|---|
date | Thu, 02 May 2024 22:46:24 -0400 |
parents | 52c2ec5ddeb5 |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/scripts/restore-document-store.sh Thu May 02 22:46:24 2024 -0400 @@ -0,0 +1,18 @@ +#!/bin/bash + +projectDir=${1:-$PWD} +snapshot=${2?Must provide snapshot name to restore} + +cd "$projectDir" || echo "Unable to change to project directory: $projectDir" + +function prop { + grep "${1}" .env/ssdt-document-store-shared.properties|cut -d'=' -f2 +} + +entityId=$(prop 'entityId' | tr -d '"') +repository="${entityId}_fs_backup" +certificate=${projectDir}/http_ca.crt +baseUrl="https://$(prop 'DOCUMENTSTORE_ELASTIC_HOST' | tr -d '"'):$(prop 'DOCUMENTSTORE_ELASTIC_PORT' | tr -d '"')" +elasticPassword=$(prop 'ELASTIC_PASSWORD' | tr -d '"') + +curl --cacert "${certificate}" -s -u elastic:"${elasticPassword}" -X POST "${baseUrl}/_snapshot/${repository}/${snapshot}/_restore?pretty" \ No newline at end of file