是否有可能防止在TeamCity的中断构建链?(Is it possible to prevent

2019-08-16 16:35发布

I have the following set-up in TeamCity 7.1.3:

Project A

  • Build & Deploy A
  • Test A (Quick)
  • Test A (Slow)
  • Test A (Very Slow)

Project B

  • Build & Deploy B
  • Test B (Quick)
  • Test B (Slow)

All of the tests for A depend on 'Build & Deploy A' and all of the tests for B depend on 'Build & Deploy B'. The dependencies are all snapshot dependencies with the following settings:

  • Do not run new build if there is a suitable one
  • Only use successful builds from suitable ones
  • Run build on the same agent

All of the tests have VCS triggers. The slow tests only run when particular folders in source control are changed. When a commit is made to project A, the following projects are added to the build queue:

  • Build & Deploy A
  • Test A (Quick)
  • Test A (Slow)
  • Test A (Very Slow)

Pre-commit builds run with higher priority in the build queue. As such, if while 'Build & Deploy A' is running a pre-commit check is made to project B, the build queue then looks like:

  • Build & Deploy B
  • Test B (Quick)
  • Test B (Slow)
  • Test A (Quick)
  • Test A (Slow)
  • Test A (Very Slow)

The problem with this set-up is that it will mean that the tests for A are run after project B has been deployed. This is an issue as the deployment of project B overwrites some of the files required by project A. The files which are being overwritten by the personal build are deployed files which are not in the checkout folder which is why they are not rolled back. Is there any way to enforce that the build chain for the tests isn't interrupted?

If I remove the 'Do not run new build if there is a suitable one' setting from the dependency, each of the tests will require a full build and deploy. The slower tests can't depend on other tests to make a linear chain as sometimes 'Test A (Very Slow)' is run, but 'Test A (Slow)' isn't.

Unfortunately it isn't currently possible to split the build and deploy to create artefacts.

Is there any way to efficiently set this up in TeamCity?

Answer 1:

下面是我收集:

  • A和B应被视为相互排斥。
  • A应当具有比B低优先建设,但
  • 一旦开始,不应中断。

有可能是打的TeamCity这一办法; 我不知道。 如果你打开改变你的过程了一下,其中一个可能会为你工作:

  1. 克隆你的环境,使得AB可以被部署到不同的目标。 这将使他们完全相互独立地运行。 使用多个生成代理(每个至少一个用于AB ),以允许更快,更高优先级B以同时为较慢,较低优先级的执行A 。 (我认为这将是一个显著振作。)
  2. 让您的加工更原子。 合并的各种构建/部署/试验片成单个结构,因此确保了的未决部分A构建链不能被移位B


Answer 2:

我有两个工作“建立和部署”生成配置写入一个文本文件包含生成类型的部署文件夹和版本号解决了这个问题。 所有测试文本文件比较值到当前建立快照依赖。 如果它们的值是不同的,重触发的生成(依赖迫使待重建),然后取消当前版本。

通过调用取消编译:

http://teamcity.jetbrains.com/guestAuth/ajax.html?comment=<CommentMessage>&submit=Stop&buildId=<BuildId>&kill

如何触发建立与设置重建依赖关系:

是否有可能迫使TeamCity的构建触发over HTTP时,重建的依赖?

这意味着,当一个测试运行合拍,部署将被重新触发,则测试运行。



文章来源: Is it possible to prevent a build chain from being interrupted in TeamCity?