I'm looking for a good organization to deploy our solution consisting in multiple apps using Gitlab and K8S.
Our SaaS app that is made of :
- A backend app, mostly our API (django)
- A user app (React)
- An admin app (React)
Both frontend apps are connected to the API.
Currently the backend and user apps are in the same gitlab repository, and are deployed using a CI/CD pipeline that builds the apps, builds the docker images, and deploy them to K8S using a Helm Chart. The Helm Chart is located in the same repo.
I recently added the admin app in another gitlab repository and I'm concerned about keeping all apps consistent, that is to say, both frontend apps have to compatible with the API.
I'm thinking about adding another repository especially for the deployment (let's call this Deploy Repo). This repo could contain:
- 3 git submodules, one for each sub app,
- The Helm chart,
- Other files related to deployment
I thought about using git submodules to be able to have separate projects. The devs would update the right versions in the Deploy Repo when a service is ready to be deployed.
The push would then trigger the CI/CD pipeline, build all apps, and deploy all together using the Helm Chart.
Is this a good idea to use submodules like this ? What could be the best practice to link multiple projects together ?
I'm also concerned about how I could do to build only the sub project that has changed instead of all projects.
I have seen that it could be possible to link the pipelines of all subprojects together, and use artifacts to pass the needed files, but I'm not sure if this is a good solution.