Submodules in gitlab-runner exec
Problem to solve
The page https://docs.gitlab.com/runner/commands/#limitations-of-gitlab-runner-exec does not contain information with regards to setting up gitlab-runner exec
when you use Relative URLs (see: https://docs.gitlab.com/ee/ci/git_submodules.html#configuring-the-gitmodules-file).
Further details
It would be useful if there was a section explaining how to clone submodules locally with an example so that gitlab-runner exec
does not fail with an error that a certain repository cannot be found.
Proposal
Example .gitmodules
file:
[submodule "subdir/repo"]
path = subdir/repo
url = ../subdir/repo.git
[submodule "library"]
path = library
url = ../library.git
Assume the repository I'm running gitlab-runner exec
in is group/application.git
you run the following clone commands to get it to work:
git clone --bare https://gitlab.local/group/subdir/repo.git subdir/repo.git
git clone --bare https://gitlab.local/group/library.git library.git
git clone https://gitlab.local/group/application.git
cd application
gitlab-runner exec shell build
Edited by Duncan Ogilvie