简体   繁体   中英

Continuous Deployment of VSTS app with Git submodules fails on Azure

I am trying to deploy a VSTS (Visual Studio Team Services) Git app including submodules to Azure using the Deployment source option in the Azure web app.

All submodules are hosted in the same VSTS project but under different Git repositories.

The deployment to Azure fails with the following error message:

fatal: could not read Username for ' https://XXX.visualstudio.com ': Bad file descriptor\\nClone of ' https://XXX.visualstudio.com/defaultcollection/Project/_git/Project.API.Models ' into submodule path 'lib/api-models' failed\\n\\r\\nD:\\Program Files (x86)\\Git\\cmd\\git.exe submodule update --init --recursive

Is there any way to deploy Git projects including submodules to Azure?

So I figured out a workaround on how to make git deployments on Azure work with submodules.

  1. Create a personal access token by clicking on clone in VSTS and then personal access token.
  2. Copy the access token and modify the URL of all submodules in the .gitmodules files.
  3. The url of the git modules should look like this afterwards: https://deployment:YOURCOPIEDAPIKEY@XXX.visualstudio.com/defaultcollection/Project/_git/Project.API.Models

Make sure you paste the API key in all submodules and submodules of submodules. Commit and push and you are good to go. The username deployment in this case can be any random name.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM