Jenkins与私有存储库的Github插件集成

时间:2016-06-07 03:46:59

标签: github jenkins jenkins-plugins githooks

我已在Azure VM中安装了Jenkins。 版本 - 1.651.2

Git之路: enter image description here

已安装的插件: 凭据插件 - 2.0.7 Git Hub Credentials插件 - 0.24 Git Hub插件 - 1.19.1 SSH凭证插件 - 1.12

enter image description here

enter image description here 在repo Url中尝试使用用户名/密码和ssh /私钥的https和ssh,仍然无法从git服务器中提取。

控制台输出:

Started by user anonymous
Building in workspace C:\Program Files (x86)\Jenkins\workspace\Staging Build
[WS-CLEANUP] Deleting project workspace...
[WS-CLEANUP] Done
Cloning the remote Git repository
Cloning repository https://github.com/--/--.git
C:\Program Files\Git\bin\git.exe init C:\Program Files (x86)\Jenkins\workspace\Staging Build # timeout=10
Fetching upstream changes from https://github.com/---/---.git
C:\Program Files\Git\bin\git.exe --version # timeout=10
using GIT_SSH to set credentials 
using .gitcredentials to set credentials
C:\Program Files\Git\bin\git.exe config --local credential.username jenkins # timeout=10
C:\Program Files\Git\bin\git.exe config --local credential.helper store --file=\"C:\Windows\TEMP\git7879671492423343442.credentials\" # timeout=10
C:\Program Files\Git\bin\git.exe -c core.askpass=true fetch --tags --progress https://github.com/---/---.git +refs/heads/*:refs/remotes/origin/* # timeout=2
ERROR: Timeout after 2 minutes
C:\Program Files\Git\bin\git.exe config --local --remove-section credential # timeout=10
ERROR: Error cloning remote repo 'origin'
hudson.plugins.git.GitException: Command "C:\Program Files\Git\bin\git.exe -c core.askpass=true fetch --tags --progress https://github.com/---/---.git +refs/heads/*:refs/remotes/origin/*" returned status code -1:
stdout: 
stderr: 
    at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1719)
    at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:1463)
    at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$300(CliGitAPIImpl.java:63)
    at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$1.execute(CliGitAPIImpl.java:314)
    at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$2.execute(CliGitAPIImpl.java:506)
    at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:1057)
    at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1097)
    at hudson.scm.SCM.checkout(SCM.java:485)
    at hudson.model.AbstractProject.checkout(AbstractProject.java:1269)
    at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:607)
    at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86)
    at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:529)
    at hudson.model.Run.execute(Run.java:1738)
    at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
    at hudson.model.ResourceController.execute(ResourceController.java:98)
    at hudson.model.Executor.run(Executor.java:410)
ERROR: null
Finished: FAILURE

注意:https://github.com/--/--.git 为了安全起见,我已经用---替换了我的回购名称,我检查了网址不匹配。 这里出了什么问题?

编辑:

我能够使用ssh和https url成功克隆gitbash。 enter image description here 在github repo中添加了部署密钥。

0 个答案:

没有答案