使用Jenkins配置本地git
在我们的组织中,我们在本地托管了git。对于我的项目,我需要在jenkins的帮助下实现CI。我知道用GitHub配置jenkins,但不确定用本地git配置它 在使用Jenkins配置本地git,git,jenkins,Git,Jenkins,在我们的组织中,我们在本地托管了git。对于我的项目,我需要在jenkins的帮助下实现CI。我知道用GitHub配置jenkins,但不确定用本地git配置它 在存储库URL中,我应该提供什么 运行git远程显示原点后 在我的存储库中,我得到如下命令 WARNING: previous mirror push of repo 'OPT' to host 'tregit1' failed, status is: 2017-06-16.19:28:39 31417 ssh: conne
存储库URL
中,我应该提供什么
运行git远程显示原点后
在我的存储库中,我得到如下命令
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)
我试图以gitbox:OPT
的形式给出Repository URL
,但在我输入gitbox:OPT
后,Jenkins给出了以下错误
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中提供什么吗?很简单:当给定别名时,ssh将查找
%HOME%/.ssg/config
与“config
”相同,而不是“conf
”
确保定义了HOME
(到C:\Users\AY
)。您的ssh配置文件名为“config
”
还要测试ssh-ic:\Users\AY\.ssh\anish-Tgitolite@10.47.52.185
确实有效
我使用了ubuntu中的gitolite.pub
,在windows中创建了anish.pub
,并将其添加到gitolite中,并更改了conf/gitolite.conf
,如下所示:
确保将gitolite.conf推回到Ubuntu服务器,并检查~gitolite/.ssh/authorized_keys
是否列出anish.pub
内容。另外,Windows
HOME/.ssh
应该包括anish.pub
和anish
(私钥)
最终能够克隆:这是HOME
环境变量的问题
这不仅仅是为了测试。我还需要配置轮询SCM。我已经清楚地给了你我得到的日志。它不是
Github
。我们在gitbox的帮助下在本地安装了git。只需给出gitbox:OPT的显示error@Ben.Bean,抱歉误解,已更新答案,请检查并还原。请尝试提供具有以下格式的url:git@hostname:repo_name.git
执行此操作之前,请确保配置git凭据(通过凭据插件)
gitolite-admin RW+ = gitolite
repo testing
RW+ = @all
repo bigfastblog
RW+ = anish