简体   繁体   中英

unable to checkout git submodules in jenkins

I've been trying unsuccessfully to configure a jenkins job that should clone a git repo with submodules. Everything goes fine until it hits "git submodule update" where it returns the following error:

12:03:17 Submodule '<name>' (https://<url>.git) registered for path '<name>' 12:03:17 + git submodule update 12:03:17 Cloning into '<name>'... 12:03:18 fatal: could not read Username for 'https://github.com': No such device or address 12:03:18 fatal: clone of 'https://<name2>' into submodule path 'data_gateway' failed 12:03:18 Build step 'Execute shell' marked build as failure 12:03:18 Finished: FAILURE I can clone the main repo with ssh using my user name (not jenkins) I've tried to create keys for Jenkins user and add them to github and also tried with user and password but none of them gets rid of this issue.

Been reading loads but couldn't find any solution. Any pointers will be highly appreciated,

Thanks

I finally fixed it adding the ssh keys for the jenkins machine to github and using ssh version of the remote url for the submodules. In jenkins' credentials configuration, you can set the actual ssh key of the machine.

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