Skip to content

Commit ef06f1a

Browse files
committed
Add database migration to auto-deployment on publish
1 parent 04c8da6 commit ef06f1a

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

.github/workflows/publish.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -305,16 +305,19 @@ jobs:
305305
# because this step 'kubectl -n default rollout status deployment/* --timeout=600s' does not work as expected
306306
# and we need the pods to be up again for cleaning and seeding the Neo4j database and the backend.
307307
# !!! this is not a perfect solution !!!
308-
# deployments are regularely up again after 3 minutes and 10 seconds
308+
# deployments are regularly up again after 3 minutes and 10 seconds
309309
- name: Sleep for 4 minutes, means 240 seconds
310310
run: sleep 240s
311311
shell: bash
312-
- name: Verify deployment and wait for the pods of each deplyment to get ready for cleaning and seeding of the database
312+
- name: Verify deployment and wait for the pods of each deployment to get ready for cleaning and seeding of the database
313313
run: |
314314
kubectl -n default rollout status deployment/ocelot-backend --timeout=600s
315315
kubectl -n default rollout status deployment/ocelot-neo4j --timeout=600s
316316
kubectl -n default rollout status deployment/ocelot-maintenance --timeout=600s
317317
kubectl -n default rollout status deployment/ocelot-webapp --timeout=600s
318+
- name: Run migrations for Neo4j database via backend for staging
319+
run: |
320+
kubectl -n default exec -it $(kubectl -n default get pods | grep ocelot-backend | awk '{ print $1 }') -- /bin/sh -c "yarn prod:migrate up"
318321
- name: Reset and seed Neo4j database via backend for staging
319322
# db cleaning and seeding is only possible in production if env 'PRODUCTION_DB_CLEAN_ALLOW=true' is set in deployment
320323
run: |

0 commit comments

Comments
 (0)