fix: correct shell script syntax in migration job init container
Some checks failed
Deploy to Production / Build and Deploy (push) Failing after 6m2s
Some checks failed
Deploy to Production / Build and Deploy (push) Failing after 6m2s
This commit is contained in:
parent
e5d7a52e59
commit
5c3833a9e4
@ -13,16 +13,21 @@ spec:
|
|||||||
initContainers:
|
initContainers:
|
||||||
- name: wait-for-postgres
|
- name: wait-for-postgres
|
||||||
image: postgres:15
|
image: postgres:15
|
||||||
command: ['sh', '-c',
|
command:
|
||||||
'echo "Waiting for PostgreSQL to be ready..." && \
|
- /bin/sh
|
||||||
for i in $(seq 1 30); do \
|
- -c
|
||||||
if pg_isready -h postgres-service -p 5432 -U prod_admin; then \
|
- |
|
||||||
echo "PostgreSQL is ready!" && exit 0; \
|
echo "Waiting for PostgreSQL to be ready..."
|
||||||
fi; \
|
for i in $(seq 1 30); do
|
||||||
echo "Attempt $i: PostgreSQL is not ready yet. Waiting..." && \
|
if pg_isready -h postgres-service -p 5432 -U prod_admin; then
|
||||||
sleep 10; \
|
echo "PostgreSQL is ready!"
|
||||||
done; \
|
exit 0
|
||||||
echo "PostgreSQL failed to become ready in time" && exit 1;']
|
fi
|
||||||
|
echo "Attempt $i: PostgreSQL is not ready yet. Waiting..."
|
||||||
|
sleep 10
|
||||||
|
done
|
||||||
|
echo "PostgreSQL failed to become ready in time"
|
||||||
|
exit 1
|
||||||
env:
|
env:
|
||||||
- name: PGPASSWORD
|
- name: PGPASSWORD
|
||||||
value: "{{ .Values.backend.env.POSTGRES_PASSWORD }}"
|
value: "{{ .Values.backend.env.POSTGRES_PASSWORD }}"
|
||||||
|
Loading…
Reference in New Issue
Block a user