在 Windows 服务器和 Mac 代理中使用服务器签出模式时,如何阻止 TeamCity 将符号链接转换为文件?
我们正在从 CC/CC.NET 组合转向 TeamCity。
我们产品的核心是Windows,但我们有Mac代理。
我们将 VCS 结帐模式设置为“在服务器上自动”。这意味着源将在 (Windows) 服务器上签出,然后根据需要复制到代理(包括 Mac 代理)。
我们的产品将 BWToolkit 框架用于其 UI 的一部分。这意味着我们将框架存储在源代码管理中。
问题是来自 TeamCity 服务器的源副本破坏了框架目录中的符号链接。这导致我们的产品无法构建(错误:BWToolkitFramework/BWToolkitFramework.h:没有这样的文件或目录
)。
这是根框架目录中的 ls -l
在我的机器上的样子:
total 24
lrwxr-xr-x 1 myuser admin 35 Nov 22 10:45 BWToolkitFramework -> Versions/Current/BWToolkitFramework
lrwxr-xr-x 1 myuser admin 24 Nov 22 10:45 Headers -> Versions/Current/Headers
lrwxr-xr-x 1 myuser admin 26 Nov 22 10:45 Resources -> Versions/Current/Resources
drwxr-xr-x 5 myuser admin 170 Nov 22 10:45 Versions
这就是它在构建机器上的样子:
total 24
-rwxrwxr-- 1 root admin 40 Nov 19 16:21 BWToolkitFramework
-rwxrwxr-- 1 root admin 29 Nov 19 16:21 Headers
-rwxrwxr-- 1 root admin 31 Nov 19 16:21 Resources
drwxrwxr-- 4 root admin 136 Nov 19 16:21 Versions
另外,而不是在构建机器上显示为链接(小箭头)覆盖在图标上)它们显示为带有 unix 可执行文件图标的文件。如果您打开这些应该是链接的文件之一,您会得到类似于以下内容的内容(来自 BWToolkitFramework 链接):
link Versions/Current/BWToolkitFramework
这似乎是 TeamCity 中服务器签出选项的问题,因为 CruiseControl 正在同一台计算机上运行,执行以下操作:直接 SVN 结帐,我没有遇到任何问题。
除了更改 TeamCity 配置以使用客户端上的 SVN 签出选项之外,还有其他方法可以解决此问题吗?
We're moving from a combination of CC/CC.NET to TeamCity.
The core of our product is Windows but we have a Mac agent.
We have our VCS checkout mode set to "Automatically on server". Meaning the source will be checked out on the (Windows) server and then copied to the agents (including the Mac agent) as needed.
Our product uses the BWToolkit framework for a portion of its UI. This means that we store the framework in our source control.
The issue is that the source copy from the TeamCity server screws up the symbolic links within the framework directory. This results in our product failing to build (error: BWToolkitFramework/BWToolkitFramework.h: No such file or directory
).
This is how an ls -l
from inside the root framework directory looks on my machine:
total 24
lrwxr-xr-x 1 myuser admin 35 Nov 22 10:45 BWToolkitFramework -> Versions/Current/BWToolkitFramework
lrwxr-xr-x 1 myuser admin 24 Nov 22 10:45 Headers -> Versions/Current/Headers
lrwxr-xr-x 1 myuser admin 26 Nov 22 10:45 Resources -> Versions/Current/Resources
drwxr-xr-x 5 myuser admin 170 Nov 22 10:45 Versions
And this is how it looks on the build machine:
total 24
-rwxrwxr-- 1 root admin 40 Nov 19 16:21 BWToolkitFramework
-rwxrwxr-- 1 root admin 29 Nov 19 16:21 Headers
-rwxrwxr-- 1 root admin 31 Nov 19 16:21 Resources
drwxrwxr-- 4 root admin 136 Nov 19 16:21 Versions
In addition instead of appearing as links on the build machine (little arrow overlay on icon) they appear as files with the unix executable icon. If you open one of these files that should be a link you get something similar to the following (this from the BWToolkitFramework link):
link Versions/Current/BWToolkitFramework
This appears to be an issue with the server checkout option in TeamCity because CruiseControl is running on the same machine doing a direct SVN checkout and I've had no issues.
Is there any way to fix this other than changing our TeamCity configuration to use the SVN checkout on client option?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
我将此问题提交为 TW-14499,希望得到官方回应/修复。
它只是被标记为 TW-5953 Symlinks are notsupported for SVN server-side checkout 的重复项,因此这是一个已开放大约 2 年的已知问题。如果其他人遇到这个问题,请对该问题投票/发表评论,希望它能得到解决。
I filed this issue as TW-14499 in hopes of an official response/fix.
It was just marked as a duplicate of TW-5953 Symlinks are not supported for SVN server-side checkout, so this is a known issue that's been open about 2 years. If anybody else runs into it please vote for/comment on the issue in hopes that it will get fixed.
显然,jgit 已于 2014 年 12 月 4 日修复了此问题,因此 TeamCity 最终将修复此问题。解决方法是告诉 TC 使用客户端代理进行 git checkout。
Apparently, jgit has fixed this as of 12/4/2014 so TeamCity will fix this eventually. Workaround is to tell TC to use client side agent for git checkouts.
与此类似(只是它是 git):
http://youtrack.jetbrains.com/issue/TW-12648
就我而言在代理而不是服务器上检查时使用 SVN。
您可以在版本控制设置的构建配置中更改此设置。
Similar to this one(just it's git):
http://youtrack.jetbrains.com/issue/TW-12648
In my case it worked with SVN when checking out on agent instead of the server.
You can change this in the Build Configuration at Version Control Settings.
这是我的场景:
由于 TeamCity 没有此修复,我创建了一个命令行脚本,在我的源代码更新后立即运行,示例如下:
此脚本正在重新创建我的 Mac 服务器上的符号链接。
Here's my scenario:
Since TeamCity doesn't have this fix in place, I created a command line script to run right after my sources are updated with the following example:
This script is recreating the symbolic links on my mac server.