I have requirement to maintain single codebase and to deploy on 100 different websites. So I have 2 repos, 1 for codebase and 2nd for the deployment logic and site metadata like path to deploy and its name maintain in 100 different txt files.
Currently I can deploy at once on all 100 website which is perfectly fine, but issue comes when there new addition of website e.g 101th site, I don’t want to run deployment cycle for all 100 website, I just want to deploy code on 101th new site.
So what is the best option to handle this kind of scenarios.
Thanks in advance.
I’d love to know more about what is this requirement of a single codebase to deploy to 100 different websites?
If you absolutely must have a single codebase, I recommend looking at the gitlab-ci
rules:changes. If your project is well organized where there is a directory per website, you can limit your CI to only run when you see changes to that specific directory automatically, and default to a manual deployment else-wise. The major downside to this is that you will have 100 jobs in a single stage (which will be quite messy) and will probably require a refactor of your deployment script to handle taking in a single website name to update.
Say you have a project structure of
| |- main.php
| |- main.php
You’re gitlab.ci.yml could look like
- when: manual
- Your deployment script using $CI_JOB_NAME
# This job's name must match the directory name in your project
You could also look into
dynamic child pipelines