Merge pull request #5097 from Ocelot-Social-Community/5093-fix-automatic-deployment

chore: 🍰 Betters Automatic Deployment To `stage.ocelot.social` On Push To `master` Branch
This commit is contained in:
Wolfgang Huß 2022-07-21 18:23:59 +02:00 committed by GitHub
commit 458f17b3bb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -4,7 +4,7 @@ on:
push:
branches:
- master
# - 5065-automatic-deployment-to-stage.ocelot.social-on-push-to-master-branch # for testing while developing
# - 5093-fix-automatic-deployment # for testing while developing
jobs:
##############################################################################
@ -300,12 +300,19 @@ jobs:
kubectl -n default rollout restart deployment/ocelot-maintenance
kubectl -n default set image deployment/ocelot-neo4j container-ocelot-neo4j=ocelotsocialnetwork/neo4j-community:$BUILD_VERSION
kubectl -n default rollout restart deployment/ocelot-neo4j
# 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.
# !!! this is not a perfect solution !!!
# deployments are regularely up again after 3 minutes and 10 seconds
- name: Sleep for 4 minutes, means 240 seconds
run: sleep 240s
shell: bash
- name: Verify deployment and wait for the pods of each deplyment to get ready for cleaning and seeding of the database
run: |
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-maintenance --timeout=600s
# kubectl -n default rollout status deployment/ocelot-webapp --timeout=600s
kubectl -n default rollout status deployment/ocelot-maintenance --timeout=600s
kubectl -n default rollout status deployment/ocelot-webapp --timeout=600s
- 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
run: |