Configure Jenkins to connect to BitBucket

两盒软妹~` 提交于 2019-12-03 22:59:18

问题


I'm trying to configure Jenkins on my Mac Mini in order to pull the code of my iPhone App from my BitBucket repository. In the "Xcode plugin" configuration area I have tried to add the git address of my project but it keeps on failing. After a research it looks like I have to use an ssh deployment key to connect Bitbucket and 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.

Unfortunately it still doesn't work.

Can anybody explain in detail the whole process?


回答1:


Ok maybe I found the solution here: 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:

ssh git@bitbucket.org

in order to add bitbucket among the known hosts




回答2:


I think the problem is in the permission for 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

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

so if I run it in SUDO mode it works.

How can I give to Jenkings the permission to run git in Admin mode?



来源:https://stackoverflow.com/questions/13267964/configure-jenkins-to-connect-to-bitbucket

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!