I have a stage in my Jenkinsfile that look like:
stage('Pull Source Code') {
steps {
script {
git branch: "master",
credentialsId: 'myCredentialId',
url: "${GIT_URL}"
}
sh 'git submodule update --recursive'
}
}
I want to provide credentials for the git git submodule update step because it giving the following error:
+ git submodule update --recursive
Cloning into 'submodule-destination-folder'...
fatal: could not read Username for 'https://tfsgit.mycompany.com': No such device or address
fatal: clone of 'https://tfsgit.mycompany.com/submodule-repo' into submodule path 'submodule-destination-folder' failed
Is there a way to provide Jenkins credentials to git submodule update ?