【问题标题】:Setting up TeamCity to work with ClearCase设置 TeamCity 以使用 ClearCase
【发布时间】:2009-12-02 04:59:27
【问题描述】:

我正在尝试设置 TeamCity 以使用 ClearCase 进行持续集成,但我遇到了一些问题。 TeamCity 抱怨它无法为构建构建补丁。我一直在 Internet 上搜索有关 ClearCase 和 TeamCity 的信息,但关于该主题的信息量非常少。有没有人成功让 TeamCity 与 ClearCase 合作?

这是我的构建日志:

[18:09:11]: Updating sources (2s)
[18:09:13]: [Updating sources] Failed to build patch for build #1.0.23-November-2009.18:09:09, build id: 10, VCS root: ClearCase, due to error: Cannot get version in view 'D:\CCdata\my_vob\my_project' for the directory D:\CCdata\my_vob\my_project
[18:09:13]: Will repeat attempt when server will be available, number of attempts left: 2
[18:09:23]: Updating sources (1s)
[18:09:25]: [Updating sources] Failed to build patch for build #1.0.23-November-2009.18:09:09, build id: 10, VCS root: ClearCase, due to error: Cannot get version in view 'D:\CCdata\my_vob\my_project' for the directory D:\CCdata\my_vob\my_project
[18:09:25]: Will repeat attempt when server will be available, number of attempts left: 1
[18:09:35]: Updating sources (2s)
[18:09:37]: [Updating sources] Failed to build patch for build #1.0.23-November-2009.18:09:09, build id: 10, VCS root: ClearCase, due to error: Cannot get version in view 'D:\CCdata\my_vob\my_project' for the directory D:\CCdata\my_vob\my_project
[18:09:37]: [Updating sources] Patch is broken, can be found in file: C:\TeamCity\buildAgent\temp\cache\temp58518patch10
[18:09:37]: [Updating sources] Error while applying patch: Failed to build patch for build #1.0.23-November-2009.18:09:09, build id: 10, VCS root: ClearCase...

这是teamcity-vcs.log 文件:

【问题讨论】:

  • 刚刚完成了我对您的cmets的回答。
  • 刚刚在jetbrains.net/devnet/thread/285255 上看到了您的(更多记录的)报告。您能否:-在runAll.shrunAll.bat 中使用-Dcc.log.commands=true 启动teamcity - 设置VCS 日志记录的调试级别(在TEAMCITY_HOME/conf/teamcity-server-log4j.xml):- 然后将您的问题附加到您的VCS 日志文件(TEAMCITY_HOME/logs/teamcity-vcs.log)?
  • 刚刚在我的回答中添加了一个修改后的配置规范供您测试

标签: continuous-integration teamcity clearcase


【解决方案1】:

正如问题Continuous Integration with Teamcity and Clearcase 中提到的,我们(我和一位同事)确实设法使 TeamCity 与 ClearCase 有效交互,但是:

  • 仅在重写了他们的 ClearCase 插件之后,并且
  • 仅将动态视图作为查找更改的来源(大型快照视图的更新花费了太多时间)

动态视图是这种插件的唯一方法,但它们的原始实现效率不高(为 每个 已更改的文件做一些cleartool describe!)

“ClearCase 视图的路径”应该是指 ClearCase 视图中源的完整路径(例如,参见 this thread

may 2009 中看到了错误消息,但当时已修复。你用的是什么路径?


关于your report on JetBrain,您的配置规范对我来说似乎很奇怪。
我会选择:

  #View files that are checked out.
  element * CHECKEDOUT

  #View files under the MyProject/LATEST branch.
  element /My_vob/... .../MyProject/LATEST

  #Create the MyProject branch.
  element -file /My_vob/... R5.0.0.0 -mkbranch MyProject
  element -dir * /main/LATEST -mkbranch MyProject

  load /My_vob

(注:

  • /”而不是“\”:两者都适用于 ClearCase,但 TeamCity 插件似乎更喜欢“/
  • .../MyProject 而不是 /main/MyProject:避免假设分支在哪里
    )

【讨论】:

  • 我试图让 TeamCity 使用快照视图或动态视图。我想动态视图是要走的路,因为每个人都在抱怨快照视图有多慢。我什至无法获得动态视图设置。我很困惑在 VCS 设置的 ClearCase 视图路径中放置什么。我不断收到错误消息:“不是 ClearCase 视图的路径”。
  • 我让它接受动态视图的视图路径,但在我原来的帖子中仍然遇到完全相同的错误:“无法为构建构建补丁”.....”无法查看版本。”
  • 这可能是 ClearCase 中的权限问题吗?我设置了 TeamCity 以使用我的用户帐户,可能我的用户帐户未正确设置为 TeamCity,甚至无法在此动态视图上执行正常操作。
  • 我已将 teamcity-vcs.log 文件附加到 jetBrains 论坛的帖子中。未生成 teamcity-clearcase.log 文件。我将不得不研究如何让那个生成。
  • 我也尝试了您对配置规范的建议,但这并没有改变结果。
【解决方案2】:

这个错误是由我的配置规范引起的。将模式 /My_vob/... 的两行更改为 * 似乎可以解决问题。我不知道为什么 TeamCity 对更精确的模式有问题,但将其更改为 * 似乎可以解决这个问题。

这是原始配置规范:

#View files that are checked out.
element * CHECKEDOUT

#View files under the MyProject/LATEST branch.
element /My_vob/... .../MyProject/LATEST

#Create the MyProject branch.
element -file /My_vob/... R5.0.0.0 -mkbranch MyProject
element -dir * /main/LATEST -mkbranch MyProject

我只是更改了两行(将 /My_vob/... 替换为 *)

#View files that are checked out.
element * CHECKEDOUT

#View files under the MyProject/LATEST branch.
element * .../MyProject/LATEST

#Create the MyProject branch.
element -file * R5.0.0.0 -mkbranch MyProject
element -dir * /main/LATEST -mkbranch MyProject

【讨论】:

  • 这是因为/... 表示“元素及其所有子元素”。含义/My_vob/... .../MyProject/LATEST 意味着My_Vob 必须有一个'MyProject' 分支,它可能不一定有。 * 有效,因为如果My_Vob 没有'MyProject' 分支,它只需跳到规则element -dir * /main/LATEST -mkbranch MyProject,选择/main/LATEST,等待任何更改以创建MyProjectbranch。接得好。 +1
【解决方案3】:

安德鲁,我们遇到了您现在遇到的同样问题。

Jetbrains 的插件存在致命缺陷,他们执行了大量的 ct lsvtree 和 ct describe 来构建缓存以查找在什么时间创建了哪些版本(对于在 clearcase 视图下可见的每个元素的每个版本)。 这就是我们编写自己的插件的原因。它使用 clearcase 配置规范的 time 指令,如 VonC 所述:Continuous Integration with Teamcity and Clearcase

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-08-10
    • 2011-11-14
    • 1970-01-01
    • 2012-04-03
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多