Our solution consists of few microservices calling and supporting each other.
To simplify, please consider this dependency graph:
MS1 --> MS2
--> MS3 --> MS4
- MS1 depends on MS2 and MS3
- MS3 depends on MS4
- MS4 is independent
GOAL: Zero downtime during deployment
Currently we are analyzing the possible ways to solve the couple scenarios described bellow:
Deploy all microservices in order, to ensure that all End-To-End tests passes. This means to deploy first MS4, then MS3, MS2, MS1, then run the tests (all of this in slots), then switch the slots if everything passes
Deploy any service individually (the others have not changed at all), run the tests (slots again), then switch the slot if everything succeeds
Our first approach is to have a single (big) pipeline which has separate stages per microservice and checks if that microservice have changed to deploy it. If no change is detected for the microservice, then we would like to cancel the Stage and proceed with the next one. This pipeline contain templates for each stage, as for example:
- stage: MS1
jobs:
- job: CheckMS1Changes
steps:
- template: templates/ms1-check-changes.yml
- job: BuildMS1
dependsOn: CheckMS1Changes
displayName: Build MS1
- template: templates/ms1-build.yml
- job: ReleaseMS1
dependsOn: BuildMS1
displayName: Release MS1
- template: templates/ms1-release.yml
We think that this will cover the described scenarios. The "cancel command" should be placed inside the templates/ms1-check-changes.yml file
The problem is that we have not found in documentation how to cancel a complete Stage. Which makes me think that maybe our complete approach is wrong. We also have not found how to cancel a Job or group of jobs, because we also have doubts if we should have stages per microservice or not.
You can see, we are new to this stuff.
Could you give some advice on what could be a good strategy for the described scenarios?