OS X Server-机器人无法从资源库获取源 [英] OS X Server - bot can't get source from repository

查看:131
本文介绍了OS X Server-机器人无法从资源库获取源的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经安装了以前版本的OS X Server,并且运行良好,但是当我安装升级到3.2.1时,我发现我的所有机器人都无法正常工作.这些是我每次尝试集成时都会遇到的问题:

I had a previous version of OS X Server set up and running fine, but when I installed the upgrade to 3.2.1, I found that none of my bots would work correctly. These are the issues I get on each attempted integration:

构建服务错误无法将数据放入缓冲区(-1).

Build Service Error Can't fit data in the buffer (-1).

构建服务警告,因为找不到工作副本,源控制操作失败.

Build Service Warning The source control operation failed because no working copy could be found.

构建服务警告,更新现有的结帐时发生错误.退回干净的结帐..

Build Service Warning An error occurred updating existing checkout. Falling back to a clean checkout..

我可能在错误的位置查看,但是我认为错误意味着我无法连接到我的Git存储库.当我从Xcode删除存储库并再次运行bot并得到相同的错误时,部分确认了这一点. (此后,我已经在Xcode中重新添加了存储库并执行了检出以对其进行测试,因此,可以肯定的是我掌握了所有的连接详细信息.)

I may be looking in the wrong place, but I think the errors mean that I can't connect to my Git repository. This was partially confirmed when I deleted my repository from Xcode and ran the bot again and got the same errors. (I have since re-added the repository in Xcode and performed a Check Out to test it, so am pretty certain I have all the connection details right.)

对于以前版本的OS X Server,我确定我已直接从服务器连接到存储库,如Help > Server Tutorials > Automate Xcode builds中所述:

With the previous version of OS X Server, I'm sure I'd connected to the repository directly from the server, as explained in Help > Server Tutorials > Automate Xcode builds:

第3步.授予Xcode服务对git存储库的访问权限

Xcode服务机器人从您的源git存储库访问项目和代码.

Xcode service bots access projects and code from your source git repository.

单击存储库",然后单击添加"按钮(+).从新建存储库"弹出菜单中选择连接到Git存储库".

Click Repositories, then click the Add button (+). Choose Connect to a Git Repository from the New Repository pop-up menu.

但是在最新版本中,当您单击添加"按钮时,您仅获得创建新存储库的选项,而不是连接到现有存储库.网络上的说明(现在)说:

But in the latest version, when you click the Add button you just get the option to create a new repository, rather than connect to an existing one. And the instructions on the web (now) say:

连接到远程存储库

如果您在远程服务器上的Git或Subversion存储库中有项目,则可以在Xcode的帐户"首选项中将您的凭据存储在开发Mac上.然后,当您需要访问存储库时,不必每次都重新输入凭据.

If you have projects in Git or Subversion repositories on remote servers, you can store your credentials for them on your development Mac in the Accounts preferences in Xcode. Then, when you need to access the repositories, you won’t have to reenter your credentials every time.

要将远程存储库的凭据添加到开发Mac

要使Xcode Server在您的项目上执行集成,它还必须有权访问其源代码存储库.配置Xcode Server以连接到远程存储库.

For Xcode Server to perform integrations on your projects, it must also have access to their source code repositories. Configure Xcode Server to connect to your remote repositories.

  • 选择Xcode>开发Mac上的偏好设置.

  • Choose Xcode > Preferences on your development Mac.

在工具栏中单击帐户".

Click Accounts in the toolbar.

单击添加"按钮(+),然后选择添加存储库".

Click the Add button (+), and choose Add Repository.

在文本字段中,输入存储库的URL(例如svn + ssh://svn.example.com/ProjectName或

In the text field, enter the URL for the repository (for example, svn+ssh://svn.example.com/ProjectName or https://example.com/git/repository.git), and click the Next button.

在帐户"偏好设置的存储库"窗格中输入您的用户名和密码.

Enter your user name and password in the Repository pane of Accounts preferences.

这有点含糊,但似乎暗示现在OS X Server使用在Xcode的首选项中设置的存储库.

which is a bit vague, but seems to suggest that now OS X Server uses repositories that are set up in Xcode's preferences.

无论如何,现在我的OS X Server似乎无法访问存储库.我在这里想念东西吗?

Anyway, now my OS X Server can't seem to access the repository. Am I missing something here?

谢谢

更新:

在假装一个月不存在后,我又回到了这个问题,并得出以下发现:

I've come back to this problem after a month of pretending it didn't exist, and have made the following findings:

-在两台不同的计算机上,OS X Server 3.2.1,OS X Server 3.2.2和OS X Server 4.0出现了问题.

-The problem occurs with OS X Server 3.2.1, OS X Server 3.2.2 and OS X Server 4.0, on two different machines.

-当存储库位于运行Gitblit的服务器上,而不是远程Bitbucket存储库或本地OS X Server中托管的Git存储库时,会发生此问题.

-The problem occurs when the repo is on a server running Gitblit, but not for remote Bitbucket repos, or for a Git repo hosted within a local OS X Server.

-该问题仅在较大的回购中发生.

-The problem only occurs for larger repos.

推荐答案

我已经以可想象的最复杂的方式解决了这个问题!

I've solved this problem in the most convoluted way imaginable!

当OS X Server连接到资源库以下载源代码时,它将使用Xcode库. Xcode使用 libgit2 进行具有

When OS X Server connects to the repository to download the source, it uses the Xcode library. Xcode uses libgit2 to do the downloading which had a known bug which caused the buffer error. It was fixed in v0.21.2, but the latest Xcode (6.1.1) only uses v0.21. That previous Xcode version only used v0.20, so hopefully a future Xcode release will use v0.21.2+ in which case this fix shouldn't be necessary.

无论如何,Xcode 6.1.1的解决方案是:

Anyway, the solution for Xcode 6.1.1 was to:

  1. 从此处下载并解压缩Xcode使用的gitlib版本: https://github.com/libgit2/libgit2/releases/tag/v0.21.0
  2. 对src/transports/http.c进行更改,如下所示: https://github .com/libgit2/libgit2/commit/7d729d0bfd897e8685099b160b6dbfd7f4ebd588
  3. 保存http.c文件
  4. 使用此处的说明来构建gitlib2的编辑版本,即:

  1. Download and unzip the version of gitlib used by Xcode from here: https://github.com/libgit2/libgit2/releases/tag/v0.21.0
  2. Make the changes to src/transports/http.c as detailed here: https://github.com/libgit2/libgit2/commit/7d729d0bfd897e8685099b160b6dbfd7f4ebd588
  3. Save the http.c file
  4. Build your edited version of gitlib2 using the instructions here, i.e:

  • 下载 CMake
  • 导航到解压缩的libgit2-0.21.0文件夹后,在Terminal中运行以下命令:

  • Download CMake
  • Run the following commands in Terminal after navigating to your unzipped libgit2-0.21.0 folder:

$ mkdir build&&光盘制作

$ mkdir build && cd build

$ cmake ..

$ cmake ..

$ cmake --build.

$ cmake --build .

在服务器上的Finder 中,转到应用程序"文件夹,右键单击Xco​​de并选择显示软件包内容".转到Contents/Developer/usr/lib文件夹,并将"libgit2.dylib"文件重命名为"libgit2.dylibold"或类似文件.

In Finder on your server, go to the Applications folder, right-click on Xcode and select "Show Package Contents". Go to the Contents/Developer/usr/lib folder and rename the 'libgit2.dylib' file to 'libgit2.dylibold' or similar.

从libgit2-0.21.0/build文件夹中获取新创建的'libgit2.0.21.0.dylib'文件,将其重命名为'libgit2.dylib'并将其复制到/Applications/Xcode/Contents服务器上的/Developer/usr/lib文件夹.

Take the newly created 'libgit2.0.21.0.dylib' file from the libgit2-0.21.0/build folder, rename it to 'libgit2.dylib' and copy it into the /Applications/Xcode/Contents/Developer/usr/lib folder on your server.

重新启动OS X Server,然后再次从Xcode集成您的bot.

Restart OS X Server, and integrate your bot again from Xcode.

这篇关于OS X Server-机器人无法从资源库获取源的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆