Mercurial > public > ssdt-docker
comparison 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 |
comparison
equal
deleted
inserted
replaced
524:6ddfd364a52a | 533:2e67cfae1533 |
---|---|
1 #!/bin/bash | |
2 | |
3 projectDir=${1:-$PWD} | |
4 snapshot=${2?Must provide snapshot name to restore} | |
5 | |
6 cd "$projectDir" || echo "Unable to change to project directory: $projectDir" | |
7 | |
8 function prop { | |
9 grep "${1}" .env/ssdt-document-store-shared.properties|cut -d'=' -f2 | |
10 } | |
11 | |
12 entityId=$(prop 'entityId' | tr -d '"') | |
13 repository="${entityId}_fs_backup" | |
14 certificate=${projectDir}/http_ca.crt | |
15 baseUrl="https://$(prop 'DOCUMENTSTORE_ELASTIC_HOST' | tr -d '"'):$(prop 'DOCUMENTSTORE_ELASTIC_PORT' | tr -d '"')" | |
16 elasticPassword=$(prop 'ELASTIC_PASSWORD' | tr -d '"') | |
17 | |
18 curl --cacert "${certificate}" -s -u elastic:"${elasticPassword}" -X POST "${baseUrl}/_snapshot/${repository}/${snapshot}/_restore?pretty" |