簡體   English   中英

使用 Jenkins git 插件的憑據

[英]Credentials on using Jenkins git plugin

我們已經安裝了 Git 服務器和 Jenkins(git 插件)。 安裝成功。 但是當我們在 Jenkins 上為構建配置作業時,我們遇到了以下問題:

Started by user admin
[EnvInject] - Loading node environment variables.
Building in workspace C:\Program Files (x86)\Jenkins\jobs\HSH\workspace
> C:\Program Files (x86)\Git\bin\git.exe rev-parse --is-inside-work-tree
Fetching changes from the remote Git repository
> C:\Program Files (x86)\Git\bin\git.exe config remote.origin.url http://localhost/Bonobo.Git.Server/HomeScreenHome.git
Fetching upstream changes from http://localhost/Bonobo.Git.Server/HomeScreenHome.git
> C:\Program Files (x86)\Git\bin\git.exe --version
FATAL: Failed to fetch from http://localhost/Bonobo.Git.Server/HomeScreenHome.git
hudson.plugins.git.GitException: Failed to fetch from http://localhost/Bonobo.Git.Server/HomeScreenHome.git
    at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:622)
    at hudson.plugins.git.GitSCM.retrieveChanges(GitSCM.java:854)
    at hudson.plugins.git.GitSCM.checkout(GitSCM.java:879)
    at hudson.model.AbstractProject.checkout(AbstractProject.java:1254)
    at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:624)
    at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86)
    at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:530)
    at hudson.model.Run.execute(Run.java:1732)
    at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
    at hudson.model.ResourceController.execute(ResourceController.java:88)
    at hudson.model.Executor.run(Executor.java:234)
Caused by: hudson.plugins.git.GitException: Failed to connect to http://localhost/Bonobo.Git.Server/HomeScreenHome.git using credentials  (status = 502)
    at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.checkCredentials(CliGitAPIImpl.java:2111)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:1151)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$200(CliGitAPIImpl.java:87)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$1.execute(CliGitAPIImpl.java:265)
at hudson.plugins.git.GitSCM.fetchFrom(GitSCM.java:620)
... 10 more

我們有一個配置了憑據和 Http Url localhost/Bonobo.Git.Server/HomeScreenHome.git的 git 服務器。 我們已經使用 Git 存儲庫 url 和與存儲庫相關的憑據配置了 Jenkins Git 插件。

我們不知道為什么會出現 502 狀態錯誤,以及為什么git clonegit fetch只能使用 git 工作。

  1. 如果它在本地主機上,您不能簡單地使用file:///...嗎?
  2. Jenkins 可能會在不同的用戶下運行,因此對普通用戶進行克隆並不能說明 Jenkins 可以做什么。 您需要在Manage Jenkins -> Configure System下添加正確的憑據

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM