2017-06-20 376 views
0

在我们的组织中,我们有本地托管的git。而对于我的项目,我需要在詹金斯的帮助下实施CI。我知道用GitHub配置jenkins,但不知道用本地git配置它。配置Jenkins的本地git

Repository URL我应该提供什么?

在我的仓库运行git remote show origin

命令后,我得到了类似下面

WARNING: previous mirror push of repo 'OPT' to host 'tregit1' failed, status is: 
2017-06-16.19:28:39  31417 ssh: connect to host 10.9.100.31 port 22: No route to host 
2017-06-16.19:28:39  31417 fatal: Could not read from remote repository. 
2017-06-16.19:28:39  31417 
2017-06-16.19:28:39  31417 Please make sure you have the correct access rights 
2017-06-16.19:28:39  31417 and the repository exists. 
---------- 
* remote origin 
    Fetch URL: gitbox:OPT 
    Push URL: gitbox:OPT 
    HEAD branch: master 
    Remote branch: 
    master tracked 
    Local branch configured for 'git pull': 
    master merges with remote master 
    Local ref configured for 'git push': 
    master pushes to master (up to date) 

,并运行此git remote -v命令的输出像

origin gitbox:OPT (fetch) 
origin gitbox:OPT (push) 

我试着给Repository URLgitbox:OPT但Jenkins在输入时出现以下错误gitbox:OPT

Failed to connect to repository : Command "git ls-remote -h gitbox:OPT HEAD" 
returned status code 128: 
stdout: 
stderr: ssh: Could not resolve hostname gitbox: Temporary failure in name resolution 
fatal: Could not read from remote repository. 

Please make sure you have the correct access rights 

和存储库存在。

任何人都可以告诉我在Git URL中提供什么?

+0

尝试提供具有以下格式的网址:'git @ hostname:repo_name.git',并在此之前,确保配置git凭证(通过凭证插件) –

回答

0

简单:当给别名时,ssh会寻找%HOME%/.ssg/config

如在“config”中,而不是“conf”。

确保HOME已定义(至C:\Users\AY)。并且你的ssh配置文件被命名为“config”。

还测试如果ssh -i C:\Users\AY\.ssh\anish -T [email protected]确实工作。

我已经使用了gitolite.pub从Ubuntu的,我在Windows中创建anish.pub并添加这gitolite和改变conf/gitolite.conf如下图所示回购

gitolite-admin RW+ = gitolite 
repo testing 
    RW+ = @all 
repo bigfastblog 
    RW+ = anish 

确保推动这一gitolite.conf回Ubuntu服务器,并检查~gitolite/.ssh/authorized_keys确实列出了anish.pub的内容。
也是Windows HOME/.ssh应包括anish.pubanish(私钥)

最后能够克隆:这是HOME环境变量的问题。

+0

它不仅用于测试。我还需要使用Poll SCM进行配置。 –

+0

我已经明确地给你了我得到的日志。它不是'Github'。我们已经在gitbox的帮助下在本地安装了git。只是通过给'gitbox:OPT'显示错误 –

+0

@ Ben.Bean,对不起,误解,更新了答案,请检查&恢复。 – LuFFy