💥 [DevOps] Fix Automatic Deployment To `stage.ocelot.social` On Push To `master` Branch
Created by: Tirokk
💥 DevOps Ticket
Fix automatic deployment to stage.ocelot.social
on push to master
Branch.
Information: You can overcome it if you rerun the failed jobs on GitHub Actions.
Issue
- relates #5080
Problem
Our publish.yml
fails on step Verify deployment and wait for the pods of each deplyment to get ready for cleaning and seeding of the database
often, see screen shot:
See file: https://github.com/Ocelot-Social-Community/Ocelot-Social/blob/master/.github/workflows/publish.yml
Increasing the flag --timeout
does not help.
What can we do? @roschaefer @Mogge
This works in my local terminal and it's the same as in the publish.yml
:
export BUILD_VERSION=1.0.8-196
echo $BUILD_VERSION
kubectl config get-contexts
kubectl -n default set image deployment/ocelot-webapp container-ocelot-webapp=ocelotsocialnetwork/webapp:$BUILD_VERSION
kubectl -n default rollout restart deployment/ocelot-webapp
kubectl -n default set image deployment/ocelot-backend container-ocelot-backend=ocelotsocialnetwork/backend:$BUILD_VERSION
kubectl -n default rollout restart deployment/ocelot-backend
kubectl -n default set image deployment/ocelot-maintenance container-ocelot-maintenance=ocelotsocialnetwork/maintenance:$BUILD_VERSION
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
kubectl -n default rollout status deployment/ocelot-backend --timeout=600s
kubectl -n default rollout status deployment/ocelot-neo4j --timeout=600s
kubectl -n default exec -it $(kubectl -n default get pods | grep ocelot-backend | awk '{ print $1 }') -- /bin/sh -c "node --experimental-repl-await dist/db/clean.js && node --experimental-repl-await dist/db/seed.js"
We could somehow wait for a certain time in GitHub Actions, but this seems not the good solution to me. Or? !!! I've done this by PR #5097 !!!
Possible Solution
!!! I've done this by PR #5097 !!!
@Elweyn showed me this …
File name: https://github.com/gradido/gradido/blob/master/.github/workflows/test.yml There we find:
...
- name: Sleep for 30 seconds
run: sleep 30s
shell: bash
...