我需要一些帮助,我已经有一个星期的问题,不知道怎么回事。我无法从从节点(Jenkins)克隆git。我添加了ssh键、主机和从键(我已经尝试为每个虚拟和主机生成一个键和一个键)。
关于詹金斯:
似乎不存在身份验证问题,因为我可以从控制台(从控制台和主机)手动克隆回购。我也可以和
ssh -T git@github.com
所以ssh键是很好的,但是当我构建时,这个键会出现在控制台上:
在工作区IE10Win7文件夹中远程构建C:\Users\IEUser\Desktop\<文件夹> 首先清除工作空间。 克隆远程Git存储库 克隆库git@github.com:< repo>.git git init C:\Users\IEUser\Desktop\< folder> # timeout=10 错误:错误克隆远程回购“原产地” 错误:错误克隆远程回购“原产地” 执行邮政建设任务..。
有谁有主意吗?希望有人能给我个提示,谢谢!
发布于 2015-06-24 07:25:51
我通过设置从节点工具路径、选择git并将其值设置为
C:\Program Files (x86)\Git\bin\git.exe
位置:配置节点-工具位置
发布于 2015-05-28 12:09:28
我最近更新了几个jenkins插件,并在更新后出现了这个问题。回滚git插件没有帮助,但我做了一些其他的事情,使它的工作。我在这里列出了这三个问题,但是很可能是(2)解决了这个问题。显然,git可执行文件被重置为默认文件。因此,在特定项目中配置git可执行文件可能是所需的全部。然而,其他项目也可能派上用场。
(1) jenkins linux安装geenrally上的默认git指向/usr/lib.您需要指定一个指向windows版本的单独GitForWindows:
Manage Jenkins
Configure System
Under Git - Git Installations
Add Git -> Git
Give it a name to be referenced in projects
(mine is WindowsGit)
Set Path to Git Executable
(mine is "C:\Program Files (x86)\Git\bin\git.exe")
(for recent git the path is "C:\Program Files\Git\bin\git.exe")
(2)在具体项目上配置git:
Select the project
Select Configure
Under Source Code Management - Git
Select Git Executable as configured in 1)
Set credentials or add new (ssh keys, etc)
(3)更新jenkins从服务以特定用户的身份运行:
Go to Windows Services on the slave -- StartMenu, type "services"
Select the Jenkins Slave service in the list on the right
Right-click and select "Properties" of the Jenkins Slave service
Select the "Log On" tab
Update the username and password used in manual tests
Domain login can be specificied with <DOMAIN>\<USERNAME>
Local logins just use <USERNAME>
OK to save and exit
Right-click again and select "Restart" to make the changes active.
发布于 2015-04-22 01:57:12
我在我的案子里找到了一个不错的解决办法。git clone
命令总是继承它的进程所有者,这可能会产生不同,即使Jenkins ( system )和cmd (用户)的两个所有者在您的系统上似乎拥有相同的权限。所有其他配置都是相同的(密钥、已知主机、Git客户端版本)。
因此,据我所见,从cmd调用git clone
将成功,因为它以用户身份调用远程,而从Jenkins调用的git clone
可能会被拒绝,因为它调用remote作为系统。在Services中,您通常通过GUI启动Jenkins,您可以将服务配置为作为一个不同的用户运行(右键单击service -> Properties -> Log )。我不得不把它写成用户@域,例如Jenkins@company.local之类的。我不确定cmd参数的外观,但我希望会有一个参数。
而且,我也不太清楚这个解决方案最终会产生什么不同,因为在我的Jenkins上,系统和用户被配置成在整个系统中拥有相同的权限,当然它们都被远程确认为"Jenkins“。不过,这对我有好处。更深层次的见解欢迎。
https://stackoverflow.com/questions/29301729
复制相似问题