fix: correct shell script syntax in migration job init container
Some checks failed
Deploy to Production / Build and Deploy (push) Failing after 6m2s

This commit is contained in:
liquidrinu 2025-05-25 13:17:58 +02:00
parent e5d7a52e59
commit 5c3833a9e4

@ -13,16 +13,21 @@ spec:
initContainers:
- name: wait-for-postgres
image: postgres:15
command: ['sh', '-c',
'echo "Waiting for PostgreSQL to be ready..." && \
for i in $(seq 1 30); do \
if pg_isready -h postgres-service -p 5432 -U prod_admin; then \
echo "PostgreSQL is ready!" && exit 0; \
fi; \
echo "Attempt $i: PostgreSQL is not ready yet. Waiting..." && \
sleep 10; \
done; \
echo "PostgreSQL failed to become ready in time" && exit 1;']
command:
- /bin/sh
- -c
- |
echo "Waiting for PostgreSQL to be ready..."
for i in $(seq 1 30); do
if pg_isready -h postgres-service -p 5432 -U prod_admin; then
echo "PostgreSQL is ready!"
exit 0
fi
echo "Attempt $i: PostgreSQL is not ready yet. Waiting..."
sleep 10
done
echo "PostgreSQL failed to become ready in time"
exit 1
env:
- name: PGPASSWORD
value: "{{ .Values.backend.env.POSTGRES_PASSWORD }}"