You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: .github/workflows/deploy.yml
+6Lines changed: 6 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -64,7 +64,13 @@ jobs:
64
64
- name: Wait for pods
65
65
run: |
66
66
kubectl wait --for=condition=ready pod -l app=postgres --timeout=120s
67
+
68
+
# Wait for postgres to actually accept connections
69
+
kubectl exec $(kubectl get pod -l app=postgres -o jsonpath="{.items[0].metadata.name}") -- sh -c "until pg_isready -h 127.0.0.1 -U postgres; do echo 'waiting for postgres...'; sleep 2; done"
70
+
71
+
# Now create the table
67
72
kubectl exec $(kubectl get pod -l app=postgres -o jsonpath="{.items[0].metadata.name}") -- psql -h 127.0.0.1 -U postgres -d todo_db -c "CREATE TABLE IF NOT EXISTS todo (todo_id SERIAL PRIMARY KEY, description VARCHAR(255));"
73
+
68
74
kubectl wait --for=condition=ready pod -l app=backend --timeout=120s
69
75
kubectl wait --for=condition=ready pod -l app=frontend --timeout=120s
0 commit comments