We have a project that is composed of multiple (non-public) repositories.
To build the whole project, the build system needs to have the files of all repositories (master
branches).
Is there a way I can configure GitLab CI to provide the repositories I need?
I guess I could do a git fetch
or similar during the CI build, but how to deal with authentication then?
You can add a deploy key to all projects. Then configure the deploy key's private key on the runner(s). Use normal git commands in your build process to clone the repositories on the runner. This may require a bit of configuration on your runners, but it should work.
You can either generate one SSH key pair and use that on all runners or generate one key pair per runner. To generate an SSH key pair follow SSH key documentation. The private key should be placed in 'gitlab-runner' user's .ssh
directory so the git
command can present it at clone time. The public key should be added to the GitLab project as a deploy key. Add a deploy key in the project settings -> 'Deploy Keys'.