I have a .net repository which is dependent on another repository so I am using the other repository as submodule.
I am using this docker image to build the repository
image: mcr.microsoft.com/dotnet/framework/sdk
But to use the submodule I have to get the latest of the submodule and that can be done using the git commands like this
before_script:
- git submodule sync --recursive
- git submodule update --init --recursive
but the git command is not available in the docker image and so it fails saying git is not recognized
Can anyone help me what should be done to have git available?
I have tried many things like dividing the build in two stages and try to use different docker image for git etc. but nothing is exactly working for my requirement.
Update
This is .gitlab-ci.yml file including the solution that jmaitrehenry suggested in his answer
stages:
- build
variables:
GIT_SUBMODULE_STRATEGY: recursive
before_script:
- docker build -t git-for-windows-issue
# Build
Build:
image: mcr.microsoft.com/dotnet/framework/sdk
stage: build
script:
- echo Ok
only:
- branches
tags:
- windows-runner
environment:
name: development
But that is also giving this error
docker : The term 'docker' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.