[英]Jenkins credentials plugin and GIT client not working
I'm using the Git Client plugin to connect Jenkins to my repository (in theory). 我正在使用Git Client插件将Jenkins连接到我的存储库(理论上)。 I'm not able to connect to repo using basic HTTP authentication.
我无法使用基本HTTP身份验证连接到repo。 When I enter the username:password manually I'm able to connect.
当我输入用户名:手动密码我能够连接。 I've tried a number of different ways to connect and nothing seems to work as expected.
我已尝试了许多不同的连接方式,似乎没有任何工作按预期工作。 If I turn off my HTTP authentication Jenkins successfully connects and builds without issue.
如果我关闭我的HTTP身份验证,Jenkins成功连接并构建没有问题。 I'm using...
我正在使用...
If I try to set the path in the job configuration via something like http://username:password@git.mydomain.com
it seems to autocheck the validaty of the path and does not complain. 如果我尝试通过
http://username:password@git.mydomain.com
之类的东西在作业配置中设置路径,它似乎会自动检查路径的有效性并且不会抱怨。 However, using this method when I actually build the job my server reports a password mismatch error (it shows the username but not the password in the error, I'm assuming a password is actually used though I'd love to know for sure). 但是,当我实际构建作业时使用此方法我的服务器报告密码不匹配错误(它显示用户名但不显示错误中的密码,我假设密码实际上已用,但我很想知道) 。 Here is the error in the Apache error_log:
这是Apache error_log中的错误:
user jenkins: authentication failure for "/info/refs": Password Mismatch
if I enter the same credentials in the credentials box it does not connect and spits out: 如果我在凭据框中输入相同的凭据,则它不会连接并吐出:
Failed to connect to repository : Command "git config --local credential.helper store --file=/var/lib/jenkins/tmp/git4177869325176518383.credentials" returned status code 129:
stdout:
stderr: error: unknown option `local'
usage: git config [options]
I don't see --local in the git manual, perhaps there is a module I need? 我没有在git手册中看到--local,也许我需要一个模块?
I had the same problem. 我有同样的问题。 The issue is that the
Jenkins Git
plugin expects to have git
version 1.8 or higher installed on the Jenkins
server - but doesn't check that or warn you that you're using an out-of-date release. 问题是
Jenkins Git
插件希望在Jenkins
服务器上安装git
1.8或更高版本 - 但不会检查或警告您使用的是过时的版本。 ( git
1.8 supports a --local
option to be specified for git config
; git
1.7 doesn't.) (
git
1.8支持为git config
指定--local
选项; git
1.7不支持。)
There are a number of options available to you to workaround this: 您可以使用多种方法来解决此问题:
Options 2 & 3 are available through the Add Git button on the Manage Jenkins/Configure System page in the Git/Git installations section. 可以通过Git / Git安装部分的Manage Jenkins / Configure System页面上的Add Git按钮获得选项2和3。
My server runs Ubuntu 10.4 LTS, for which there is no git 1.8 package available in the standard repositories, and I prefer not to install non-packaged software on my server, so that ruled out option 1 for me. 我的服务器运行Ubuntu 10.4 LTS,标准存储库中没有可用的git 1.8软件包,我不想在我的服务器上安装非打包软件,因此排除了我的选项1。 I found the configuration for option 2 to be too onerous, and didn't give me a warm feeling that it would continue to work for new git releases.
我发现选项2的配置过于繁琐,并没有给我一种温暖的感觉,它会继续适用于新的git版本。 So that left me with option 3, which has been working OK for me.
所以这给了我选项3,这对我来说一直很好。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.