Multiple .gitlab-ci.yaml files per repository that run different pipelines

Hi all, I’m looking for a way to define multiple gitlab-ci config files (preferably in different sub-directories) and then using a variable in a trigger or via the api, select which gitlab-ci script I want to use when I trigger a pipeline. One idea I had is to use a variable in the path of an “include” local definition to allow the variable to specify the path of a different included file.

Basically, I’m looking for a way to trigger multiple completely different pipelines from the same repository based on some input. I’m looking to do this because I have a repo with a non-fixed number of “micro-codebases” in them and I want to run a different pipeline depending on the directory (micro-codebase) that I’m interested in. For a concrete example, I have a mono-repo and I don’t want to run the build/tests/linting on every single “micro-codebase” in that repo on every build.

Is this possible in Gitlab? If not, are there any “creative” ways to achieve this?

I think this is possible with generated includes. Basically, you can create an artifact file that is your “child” gitlab CI config file. Then you can reference the artifact in your trigger.

More information here