chore: 馃嵃 Automatic Deployment To `stage.ocelot.social` On Push To `master` Branch
requested to merge 5065-automatic-deployment-to-stage.ocelot.social-on-push-to-master-branch into master
Created by: Tirokk
馃嵃 Pullrequest
Automatic deployment to stage.ocelot.social
on push to (merge into) master
branch.
See:
- https://docs.digitalocean.com/products/kubernetes/how-to/deploy-using-github-actions/
- https://docs.digitalocean.com/tutorials/build-and-deploy-your-first-image-to-your-first-cluster/
- especially:
Issues
- fixes #5065 (closed)
- follow up #5093 (closed)
Todo
First Step
-
use kubectl
ordoctl
to change the docker image in the deployments
Commands for branded
:
kubectl -n default set image deployment/ocelot-webapp container-ocelot-webapp=ocelotsocialnetwork/webapp-branded:latest
kubectl -n default set image deployment/ocelot-backend container-ocelot-backend=ocelotsocialnetwork/backend-branded:latest
kubectl -n default set image deployment/ocelot-maintenance container-ocelot-maintenance=ocelotsocialnetwork/maintenance-branded:latest
kubectl -n default set image deployment/ocelot-neo4j container-ocelot-neo4j=ocelotsocialnetwork/neo4j-community-branded:latest
Commands for not(!) branded
:
kubectl -n default set image deployment/ocelot-webapp container-ocelot-webapp=ocelotsocialnetwork/webapp:latest
kubectl -n default set image deployment/ocelot-backend container-ocelot-backend=ocelotsocialnetwork/backend:latest
kubectl -n default set image deployment/ocelot-maintenance container-ocelot-maintenance=ocelotsocialnetwork/maintenance:latest
kubectl -n default set image deployment/ocelot-neo4j container-ocelot-neo4j=ocelotsocialnetwork/neo4j-community:latest
If we really want to use the not changing tag latest
then we need kubectl rollout restart deployment/*
for all deployments of us in the cluster after setting the image!
Then
-
add the change of the Docker image in the deployments of stage.ocelot.social
topublish.yaml
-
it looks like we should use explicit versions and avoid latest
for production- if a pod restarts it may pull a wrong docker image that is to new
- warnings against using
latest
:
- warnings against using
- if a pod restarts it may pull a wrong docker image that is to new
-
-
weigh out kubectl set image
againstkubectl patch
-
I go for kubectl set image
-
-
using helm
would be nice either, but the Helm scripts are in our other repository: Ocelot-Social-Deploy-Rebranding-
impossible yet
-
General
-
change back to publish on master
branch push -
add release version, see #5094 (closed) -
set DigitalOcean access token in the repo -
seed db -
add PRODUCTION_DB_CLEAN_ALLOW
and set it correct for staging totrue
-
add chrone job to seed db every night?
-
-
add documentation to here or on deploy/rebrand how to change the image name and trigger an image pull on a Kubernetes cluster -
fix ocelotsocialnetwork/webapp:latest
andocelotsocialnetwork/backend:latest
on start in cluster, see https://github.com/Ocelot-Social-Community/Ocelot-Social/issues/5065#issuecomment-1179732798-
!!! do this before this issue in a new issue -
create new issue #5066 (closed)
-
-
-
rename maintenance container from maintenance
tocontainer-ocelot-maintenance
?- if not yet create an issue
-
clean up: search for Wolle