I'm trying to set up Jenkins (running on windows) to download a private repository from github.com using the github plugin. It is working fine for our public repositories, but for private, no matter what I do, it hangs then times out like so:
Fetching changes from the remote Git repository
git.exe config remote.origin.url https://github.com/
myorganization/MyProjectName.git # timeout=10
Fetching upstream changes from
https://github.com/myorganization/MyProjectName.git
git.exe --version # timeout=10
git.exe fetch --tags --progress
https://github.com/myorganization/MyProjectName.git +refs/heads/*:refs/remotes/origin/*
ERROR: Timeout after 10 minutes
ERROR: Error fetching remote repo 'origin'
Questions:
Is possible to have Jenkins pull the repo using https and credentials instead of ssh. If so, what's the trick? Obviously its theoretically possible can since I never had any deploy keys on my git account or repos and yet Visual Studio is able to interact with the repo using my credentials and https. ...but VS and GitHub for Windows are registered as "authorized applications" on the GitHub site. https://www.blazemeter.com/blog/how-start-working-github-plugin-jenkins sounds like just what I'm looking for, and I did the token generation on the git site, set github.com as my git server on Jenkins, tested it using the generated GitHub token (on the Jenkins server config page) and it works, but when I do the build, it won’t pull the repo.
If you cannot do it the same way in Jenkins, why do they would have the field in the build config for assigning credentials to git? Those credentials aren't used for ssh are they?
If it's possible, why does all of the documentation seem to point to using deploy keys and ssh? What's the advantage? It seems like a hassle generating key pairs and "known_hosts" files instead of just entering a username/password.
Any idea why it times out and doesn’t simply fail right away?
Background: I have read a lot about it and it seems like everyone does things differently, for example this: Authenticate Jenkins CI for Github private repository Most people seem to be going through this process of generating key pairs and using ssh. I've been going down that path and the combination of corporate security and lack of documentation has made it rather painful (I think I'm close but the firewall is blocking me, so I'm looking at other options before I plead my case to the networking guys).
Follow-up: I ended up going the ssh route and it works, but I'd still be curious to know if http + credentials is possible and why the github plugin has a space for credentials...