To make sure my app is ready for a production workload I have to test at least:
- My code is in compliance with conventions (public or company conventions)
- My code doesn't have an identified security breach (I don't want to expose my customer data)
- I'm able to execute my code in a controlled environment
- I'm able to make a request to get vote (I must have a 200 code as return on my GET request), since i'm in a controlled environment I must have 0 for each categories
- I'm able to make a request to publish vote (I must have a 200 code as return on my POST request), since i'm in a controlled environment I must have 1 for the one i've voted and 0 to the other
This workflow works when you're working on differents branches, and you want to merge your branch with main
- Pull Request is Opened
- I'm checking if the code respect the Python convention using Flake8 (Because I'm respecting python writing conventions)
- I'm checking if there is any CVEs opened, to make sure my code is secure. The last thing I want is to send security breach on my production environment
- I'm making sure in a controlled environment (Here using docker-compose), my system is working as expected and i'm able to interact it
- If and only if, all these requirements are meet, I'm able to merge into main my code
This workflow will be triggered when a reviewer or my self gonna click on the merge button
- Semantic release bot is triggered, it analyze commit messages to calculate the version number, when done, it publish a version on github https://www.conventionalcommits.org/en/v1.0.0/
- I'm logging in my Docker Registry to being able to push my Docker image
- I'm preparing the environment to being able to build my Dockerfile
- I'm building my Dockerfile and name it using this format
<Docker Registry>/<Repository Name>:<Semantic Release version>
(eg. joffreydupire/simplon-vote-app:v1.0.0) then i'm pushing it to the registry. - Finally using
helm upgrade
command I'm deploying my Azure-Vote-App workload into my K8s cluster
NOTES: From there, I could decide to deploy a canary or used a Blue/Green line