As you may already know, for decades, to build a cobol source on z/OS, you can submit a JCL.
Now we will see how to manage build of your cobol sources from a git server like Gitlab.
The receipt I propose is this one :
1- Get the different JCL corresponding of the different kind of build you do (cobol-batch-db2, cobol-cics-db2, cobol-batch-cics-db2...)
2- From each of these JCL, produce a Rexx skeleton, replacing some values by variables. (Cobol version PDS prefix, build parameters, targetted load libraries, dbrm libraries...).
3- Create a Rexx source, that will take as parameters, the name of the cobol source, the kind of build to do, the type of build (userbuild, teambuild, pre-package build), the targeted dev environment. Then this rexx code can be something like :
4- Gather a dockerfile to produce a docker image that will be started by the CI pipeline, a small linux with Zowe CLI, the RSE plugin or z/OSMF.
5- Code the YAML pipeline file with zowe cli command to :
6- To manage dependencies, set a rule for the pipeline to first copy the COPYBOOK, if some have been modified.
The good point of this method I propose is you don't have any vendor lock-in and you can adapt it the way you want. And it is based on standard z/OS components.