Skip to content

Commit

Permalink
build: only run db backup for odk if CENTRAL_DB_HOST is not default
Browse files Browse the repository at this point in the history
  • Loading branch information
spwoodcock committed Aug 1, 2024
1 parent 2afc4d0 commit 1d11b07
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/backend/backup-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,9 @@ while true; do
"${FMTM_DB_NAME:-fmtm}" "${FMTM_DB_PASSWORD}"
pretty_echo "### Backup FMTM Complete ###"

# Only run ODK Central DB Backups if variables set
if [ -n "${CENTRAL_DB_PASSWORD}" ]; then
# Only run ODK Central DB Backups if CENTRAL_DB_HOST is set and not
# equal to default value from .env.example: 'central-db'
if [ -n "${CENTRAL_DB_HOST}" ] && [ "${CENTRAL_DB_HOST}" != "central-db" ]; then
pretty_echo "### Backup ODK Central $(date +%Y-%m-%d_%H:%M:%S) ###"
check_central_db_vars_present
wait_for_db "${CENTRAL_DB_HOST:-central-db}"
Expand Down

0 comments on commit 1d11b07

Please sign in to comment.