Sync repo.
This commit is contained in:
+14
-18
@@ -15,24 +15,21 @@ set -e
|
||||
SCRIPT_DIR=$(dirname "$0")
|
||||
source "${SCRIPT_DIR}/utils.sh"
|
||||
source "${SCRIPT_DIR}/common.sh"
|
||||
|
||||
if [ "${INSTANCE_TYPE}" = "bitbucket-mesh" ]; then
|
||||
# Mesh nodes don't run with an external database, so it doesn't need to be restored
|
||||
BACKUP_DATABASE_TYPE="none"
|
||||
# Mesh nodes don't run with an external Elasticsearch instance configured, so it doesn't need to be restored
|
||||
BACKUP_ELASTICSEARCH_TYPE="none"
|
||||
fi
|
||||
source "${SCRIPT_DIR}/func.sh"
|
||||
source "${SCRIPT_DIR}/vars.sh"
|
||||
source "${SCRIPT_DIR}/lvm.sh"
|
||||
source "${SCRIPT_DIR}/dbase.sh"
|
||||
|
||||
source_archive_strategy
|
||||
source_database_strategy
|
||||
source_disk_strategy
|
||||
source_elasticsearch_strategy
|
||||
|
||||
# Ensure we know which user:group things should be owned as
|
||||
if [ -z "${BITBUCKET_UID}" -o -z "${BITBUCKET_GID}" ]; then
|
||||
error "Both BITBUCKET_UID and BITBUCKET_GID must be set in '${BACKUP_VARS_FILE}'"
|
||||
bail "See 'bitbucket.diy-backup.vars.sh.example' for the defaults."
|
||||
fi
|
||||
|
||||
# # Ensure we know which user:group things should be owned as
|
||||
# if [ -z "${BITBUCKET_UID}" -o -z "${BITBUCKET_GID}" ]; then
|
||||
# error "Both BITBUCKET_UID and BITBUCKET_GID must be set in '${BACKUP_VARS_FILE}'"
|
||||
# bail "See 'bitbucket.diy-backup.vars.sh.example' for the defaults."
|
||||
# fi
|
||||
|
||||
check_command "jq"
|
||||
|
||||
@@ -47,13 +44,15 @@ info "Preparing for restore"
|
||||
|
||||
prepare_restore_disk "${1}"
|
||||
prepare_restore_db "${1}"
|
||||
prepare_restore_elasticsearch "${1}"
|
||||
|
||||
copy_archive_to_tmp
|
||||
|
||||
if [ -n "${BACKUP_ARCHIVE_TYPE}" ]; then
|
||||
restore_archive
|
||||
fi
|
||||
|
||||
info "Restoring disk (home directory and data stores) and database"
|
||||
|
||||
info "Restoring disk and database"
|
||||
|
||||
# Restore the filesystem
|
||||
restore_disk "${1}"
|
||||
@@ -61,9 +60,6 @@ restore_disk "${1}"
|
||||
# Restore the database
|
||||
restore_db
|
||||
|
||||
# Restore Elasticsearch data
|
||||
restore_elasticsearch
|
||||
|
||||
success "Successfully completed the restore of your ${PRODUCT} instance"
|
||||
|
||||
if [ -n "${FINAL_MESSAGE}" ]; then
|
||||
|
||||
Reference in New Issue
Block a user