简体   繁体   English

配置Jenkins以连接到BitBucket

[英]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.

相关问题 在推送到Bitbucket上的随机存储库上运行Jenkins构建 - Run Jenkins build on push to random repository on Bitbucket 根据拉取请求从 Bitbucket 触发 Jenkins 作业 - Trigger Jenkins Job from Bitbucket on Pull Request 无法将詹金斯连接到gitlab - Can't connect jenkins to gitlab 如何配置jenkins将构建工件上传到nexus? - How to configure jenkins to upload build artifact to nexus? 配置Jenkins作业以从SVN中选择应用程序和中继/标记/分支 - Configure a Jenkins job to select an application and trunk/tags/branches from SVN 我无法配置电子邮件Jenkins Extension - I can not configure e-mail Jenkins Extension Jenkins - 作业 Y 配置为在作业 x 之后运行,但未触发 - Jenkins - Job Y is configure to run after Job x, but is not triggered 您可以通过jenkins TFS配置增量构建吗 - Can you configure incremental builds via jenkins TFS bitbucket 管道构建实例的默认实例规范是什么,例如 CPU、Ram 等,我们可以配置它吗? - What is the default instance spec for bitbucket pipeline build instances, e.g. CPU, Ram etc, can we configure it? 通过HTTP Post-Commit Hook将Github连接到安全的Jenkins - Connect Github to secured Jenkins via HTTP Post-Commit Hook
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM