Issue: Update sub modules from remote via script during CI build
During a CI build script, I want the sub module to be updated to the latest as it is building. I am aware that the build process in VSTS takes care of checking out the sub modules, but they are checked out at the hash reference of whatever is there in the repository. I would like the process to update to the latest code.
The approach I used is as described below.
• I created a command line task in the build pipeline and added the script as below.
git -c http.https://bitbucket.org.extraheader="AUTHORIZATION: bearer $(System.AccessToken)" submodule update --init --force --recursive --remote –merge
• I also checked out check Allow scripts to access OAuth Options in build definition and pass $(System.AccessToken)
variable in the command above.
It seems to be the command line script is causing the problem and showing the following error message:
Could not read Username for https://bitbucket.org: terminal prompts disabled.
The build agent is able to execute other git commands such as pulling down the source, checkout the sub modules etc. Sub modules are accessed through https.
• How can I get the authorization done on my command line task??
• Is there any other approach to allow Git Sub modules to pull latest commits?