helm-charts/postgresql/files/_run

18 lines
445 B
Text
Raw Permalink Normal View History

2023-09-26 00:12:53 +02:00
#!/usr/bin/env bash
RETRIES={{ .Values.job.retries }}
until psql -c "select 1" > /dev/null 2>&1 || [ $RETRIES -eq "0" ]; do
echo "Waiting {{ .Values.job.wait }}s for postgres server, $((RETRIES--)) remaining attempts..."
sleep {{ .Values.job.wait }}
done
if [ ${RETRIES} -eq "0" ]; then
echo "Maximum wait attempts exceeded, aborting".
exit 1;
fi
set -e
for script in *.sh; do
echo "**** execute script ${script}"
./${script}
done