如何提高teamcity构建性能?

时间:2022-12-27 19:12:16

I have the following steps for my project:

我的项目有以下步骤:

  1. build
  2. unit tests
  3. test coverage
  4. duplicates finder
  5. fx cop

Is there any way to make TeamCity execute 2-5 steps in parallel? Can I use several build agents for that?

有没有办法让TeamCity并行执行2-5步?我可以使用几个构建代理吗?

1 个解决方案

#1


11  

Yes. Assuming you have at least four build agents, you can do the following:

是。假设您至少有四个构建代理,则可以执行以下操作:

  1. Under MyProject, define 5 build configurations (Build, Unit Tests, etc).
  2. 在MyProject下,定义5个构建配置(构建,单元测试等)。

  3. Edit build configurations 2-5, and define a new Trigger in Build Triggering (Choose Finish Build Trigger, and set it to run after a successful run of Build.
  4. 编辑构建配置2-5,并在构建触发中定义新的触发器(选择完成构建触发器,并将其设置为在成功运行构建后运行。

  5. Edit build configurations 2-5, and define a new Artifact dependency in Dependencies (Choose Add new artifact dependency, and choose the output of your Build configuration.
  6. 编辑构建配置2-5,并在Dependencies中定义新的Artifact依赖项(选择Add new artifact dependency,然后选择Build配置的输出。

As long as you have agents available, the build configurations will run after a successful Build, each on its own agent.

只要您有可用的代理,构建配置将在成功构建之后运行,每个构建配置都在其自己的代理上。

On a side note, without knowing your specific project, i'd recommend doing that only if the whole process takes a really long time (lets say more than ~15 minutes), and you can spare those machines (virtual or not).

另外,在不知道您的具体项目的情况下,我建议仅在整个过程需要很长时间(比如说超过15分钟)时才这样做,并且您可以省去这些机器(虚拟或非虚拟)。

#1


11  

Yes. Assuming you have at least four build agents, you can do the following:

是。假设您至少有四个构建代理,则可以执行以下操作:

  1. Under MyProject, define 5 build configurations (Build, Unit Tests, etc).
  2. 在MyProject下,定义5个构建配置(构建,单元测试等)。

  3. Edit build configurations 2-5, and define a new Trigger in Build Triggering (Choose Finish Build Trigger, and set it to run after a successful run of Build.
  4. 编辑构建配置2-5,并在构建触发中定义新的触发器(选择完成构建触发器,并将其设置为在成功运行构建后运行。

  5. Edit build configurations 2-5, and define a new Artifact dependency in Dependencies (Choose Add new artifact dependency, and choose the output of your Build configuration.
  6. 编辑构建配置2-5,并在Dependencies中定义新的Artifact依赖项(选择Add new artifact dependency,然后选择Build配置的输出。

As long as you have agents available, the build configurations will run after a successful Build, each on its own agent.

只要您有可用的代理,构建配置将在成功构建之后运行,每个构建配置都在其自己的代理上。

On a side note, without knowing your specific project, i'd recommend doing that only if the whole process takes a really long time (lets say more than ~15 minutes), and you can spare those machines (virtual or not).

另外,在不知道您的具体项目的情况下,我建议仅在整个过程需要很长时间(比如说超过15分钟)时才这样做,并且您可以省去这些机器(虚拟或非虚拟)。