[英]Configure Jenkins to connect to BitBucket
I'm trying to configure Jenkins on my Mac Mini in order to pull the code of my iPhone App from my BitBucket repository. 我正在尝试在我的Mac Mini上配置Jenkins,以便从我的BitBucket存储库中提取我的iPhone应用程序的代码。 In the "Xcode plugin" configuration area I have tried to add the git address of my project but it keeps on failing.
在“Xcode插件”配置区域中,我尝试添加项目的git地址但它仍然失败。 After a research it looks like I have to use an ssh deployment key to connect Bitbucket and Jenkins.
经过研究,看起来我必须使用ssh部署密钥来连接Bitbucket和Jenkins。 What I have done so far:
到目前为止我做了什么:
ssh-keygen -t rsa
pbcopy < /Users/jenkins/.ssh/id_rsa.pub
and I added this SSH key to my BitBucket profile. 我将此SSH密钥添加到我的BitBucket配置文件中。
Unfortunately it still doesn't work. 不幸的是它仍然无效。
Can anybody explain in detail the whole process? 任何人都可以详细解释整个过程吗?
Ok maybe I found the solution here: http://colonelpanic.net/2011/06/jenkins-on-mac-os-x-git-w-ssh-public-key/ 好吧,也许我在这里找到了解决方案: http : //colonelpanic.net/2011/06/jenkins-on-mac-os-x-git-w-ssh-public-key/
Remember to re-generate the keys with: 请记住重新生成密钥:
ssh-keygen -t rsa
to copy it with: 复制它:
pbcopy < /Users/Shared/Jenkins/Home//.ssh/id_rsa.pub
to upload it in BitBucket and run: 将其上传到BitBucket并运行:
ssh git@bitbucket.org
in order to add bitbucket among the known hosts 为了在已知的主机中添加bitbucket
I think the problem is in the permission for git. 我认为问题在于对git的许可。 In the error log the command which is failing is
在错误日志中,失败的命令是
/usr/local/git/bin/git clone --progress -o origin git@bitbucket.org:myname/myproject.git/Users/Shared/Jenkins/Home/jobs/MyProjectAdHocBuild/workspace
/ usr / local / git / bin / git clone --progress -o origin git@bitbucket.org:myname/myproject.git / Users / Shared / Jenkins / Home / jobs / MyProjectAdHocBuild / workspace
If I try to run it in the console I get this: 如果我尝试在控制台中运行它,我会得到这个:
fatal: could not create work tree dir '/Users/Shared/Jenkins/Home/jobs/MyProjectAdHocBuild/workspace'.: Permission denied
致命:无法创建工作树目录'/ Users / Shared / Jenkins / Home / jobs / MyProjectAdHocBuild / workspace':权限被拒绝
so if I run it in SUDO mode it works. 所以如果我在SUDO模式下运行它就可以了。
How can I give to Jenkings the permission to run git in Admin mode? 如何向Jenkings授予在管理员模式下运行git的权限?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.