How can I prevent concurrent builds in CruiseControl.NET?

ε祈祈猫儿з 提交于 2019-12-04 10:46:14

问题


We have several projects in CruiseControl and I noticed that often 2 or more projects are building at the same time. This seems to be causing conflicts. Often, a build fails and if I look at the reason, it's failing to access some file, and if I wait until the other build completes, I can just force-build the failed build and it will succeed.

How can I configure CC so that it won't run builds concurrently if they are going to conflict with each other?


回答1:


You have to do all builds that depend on each other, in one queue.

The cruise control project configuration element has two attributes to control concurrency and order of build:

<project name="Project 1" queue="Q1" queuePriority="1">

With queue you can define in which queue the project shall be build, with queuePriority you can define the order of builds when several builds are requested.

So two projects that cannot be build in parallel have to be on the same queue, say queue="Q1". When the second projects is dependend on the first one, the second project must have a higher priority than the first.




回答2:


You can use the Locking feature to define queus that should not run at the same time.

This is available in version 1.4.3

A sample from the documentation:

<cruisecontrol>
  <queue name="Q1" lockqueues="Q2"/>
  <queue name="Q2" lockqueues="Q1"/>

  <project name="MyFirstProject" queue="Q1" queuePriority="1">
    ...
  </project>
  ...

  <project name="MySecondProject" queue="Q2" queuePriority="1">
    ...
  </project>
  ...
</cruisecontrol>


来源:https://stackoverflow.com/questions/1336502/how-can-i-prevent-concurrent-builds-in-cruisecontrol-net

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