Files
Odoo-Build/images/odoo/bin/wait-for-pg
T
Janik von Rotz 069648b278 feat(images/odoo): enforce bash coding conventions and improve git config handling
- Enforce bash coding conventions across all scripts as outlined in new AGENTS.md
- Convert local variables to lowercase and use proper quoting
- Update conditionals to use `[[ ... ]]` and remove `function` keyword
- Add support for setting git author name and email via env vars
- Improve SSH key handling and git operations
- Update documentation and changelog to reflect changes
2025-10-29 19:03:23 +01:00

16 lines
375 B
Bash
Executable File

#!/usr/bin/env bash
set -e
max_attempts=30
sleep_seconds=5
attempts=0
until pg_isready -h "$PGHOST" -p "$PGPORT"; do
attempts=$((attempts+1))
if [[ "$attempts" -ge $max_attempts ]]; then
log-entrypoint 'Database is not reachable after 30 attempts.'
exit 1
fi
log-entrypoint "Waiting for database... ($attempts)"
sleep $sleep_seconds
done