mirror of
https://github.com/Ocelot-Social-Community/Ocelot-Social.git
synced 2025-12-13 07:46:06 +00:00
Add database migration to auto-deployment on publish
This commit is contained in:
parent
04c8da6a6c
commit
ef06f1a67d
7
.github/workflows/publish.yml
vendored
7
.github/workflows/publish.yml
vendored
@ -305,16 +305,19 @@ jobs:
|
|||||||
# because this step 'kubectl -n default rollout status deployment/* --timeout=600s' does not work as expected
|
# because this step 'kubectl -n default rollout status deployment/* --timeout=600s' does not work as expected
|
||||||
# and we need the pods to be up again for cleaning and seeding the Neo4j database and the backend.
|
# and we need the pods to be up again for cleaning and seeding the Neo4j database and the backend.
|
||||||
# !!! this is not a perfect solution !!!
|
# !!! this is not a perfect solution !!!
|
||||||
# deployments are regularely up again after 3 minutes and 10 seconds
|
# deployments are regularly up again after 3 minutes and 10 seconds
|
||||||
- name: Sleep for 4 minutes, means 240 seconds
|
- name: Sleep for 4 minutes, means 240 seconds
|
||||||
run: sleep 240s
|
run: sleep 240s
|
||||||
shell: bash
|
shell: bash
|
||||||
- name: Verify deployment and wait for the pods of each deplyment to get ready for cleaning and seeding of the database
|
- name: Verify deployment and wait for the pods of each deployment to get ready for cleaning and seeding of the database
|
||||||
run: |
|
run: |
|
||||||
kubectl -n default rollout status deployment/ocelot-backend --timeout=600s
|
kubectl -n default rollout status deployment/ocelot-backend --timeout=600s
|
||||||
kubectl -n default rollout status deployment/ocelot-neo4j --timeout=600s
|
kubectl -n default rollout status deployment/ocelot-neo4j --timeout=600s
|
||||||
kubectl -n default rollout status deployment/ocelot-maintenance --timeout=600s
|
kubectl -n default rollout status deployment/ocelot-maintenance --timeout=600s
|
||||||
kubectl -n default rollout status deployment/ocelot-webapp --timeout=600s
|
kubectl -n default rollout status deployment/ocelot-webapp --timeout=600s
|
||||||
|
- name: Run migrations for Neo4j database via backend for staging
|
||||||
|
run: |
|
||||||
|
kubectl -n default exec -it $(kubectl -n default get pods | grep ocelot-backend | awk '{ print $1 }') -- /bin/sh -c "yarn prod:migrate up"
|
||||||
- name: Reset and seed Neo4j database via backend for staging
|
- name: Reset and seed Neo4j database via backend for staging
|
||||||
# db cleaning and seeding is only possible in production if env 'PRODUCTION_DB_CLEAN_ALLOW=true' is set in deployment
|
# db cleaning and seeding is only possible in production if env 'PRODUCTION_DB_CLEAN_ALLOW=true' is set in deployment
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user