I have several projects, each in their own repository, that import a common library which has its own repository as well.
So, the .gitmodules
file includes the library with the full name:
Submodule 'xx/yy' (https://gitlab.com/xx/yy.git) registered for path 'xx/yy'
but this doesn't work:
Fatal: could not read Username for 'https://gitlab.com': No such device or address
the CI script is very simple:
image: mcr.microsoft.com/dotnet/core/sdk:3.0.100-preview9-alpine3.9
variables:
GIT_SUBMODULE_STRATEGY: recursive
stages:
- build
before_script:
- "cd xx"
- "dotnet restore"
build:
stage: build
script:
- "cd xx"
- "dotnet build"
The old answer was: GitLab pull submodules inside CI
but things have changed and we can, according to the docs, have submodules that don't have a relative path, as written here: https://docs.gitlab.com/ce/ci/git_submodules.html