5

I have a TeamCity project which includes 4 configurations and the build chain needs to look something like this:

Build Chain set up

Build which can be triggered manually and executes .bat scripts that compiles a bunch of artifacts for the Deploy and TEST to pick up.

Deploy and TEST – Region 1 has an artifact dependency on the Build config.

Deploy and TEST – Region 2 has an artifact dependency on the Build config.

Since I wanted both Region1 and Region2 to run in parallel as soon as Build is successful, I added a Snapshot dependency to Deploy and TEST – Region 1 and Deploy and TEST – Region 2 on Build config

Now I need to configure the Test Status config just to report the failure/success of the previous config (Deploy and TEST configs).

How can this be achieved? Also, do I need to tweak my set up anywhere for the use case I am trying to achieve?

fledgling
  • 991
  • 4
  • 25
  • 48

1 Answers1

2

The setup looks correct. To get the build chain status in Test Status configuration, you need to add snapshot dependencies on Deploy and TEST – Region 1 and Deploy and TEST – Region 2 configurations. If any build from the chain fails, Test Status build will also fail with status: "Snapshot dependencies failed:​ .​.​.​ < build configurations names >"

If you add these snapshot dependencies and run Test Status via UI, the whole build chain will be added to the queue. Also you can configure one VCS trigger in Test Status build configuration with option "Trigger on changes in snapshot dependencies". With this options enabled, the whole build chain will be triggered even if changes are detected in dependencies, not in the resulting build.

This article can be helpful.

Alina Mishina
  • 3,320
  • 2
  • 22
  • 31
  • That works! But for some strange reason Deploy and TEST – Region 1 and Deploy and TEST – Region 2 does not run in parallel even after adding snapshot dependencies. Any idea why? – fledgling Jun 28 '16 at 15:48
  • Do you have both builds (Deploy and TEST – Region 1 and Deploy and TEST – Region 2) added to the build queue? Are there several idle agents that can run these builds? – Alina Mishina Jun 29 '16 at 11:01
  • When I run Test Status config, I have 4 configs added to the Build queue in this order 1) Build 2)Deploy and TEST – Region 1 3)Deploy and TEST – Region 2 4)Test Status. These builds have explicit requirements to run on one specific agent. – fledgling Jun 29 '16 at 13:27
  • 1
    TeamCity [cannot run several builds on one agent at the same time](https://youtrack.jetbrains.com/issue/TW-1898). Why do you have a requirement to run all builds on one specific agent? – Alina Mishina Jun 29 '16 at 13:56
  • Ok. I didn't know that. So adding another agent on the same machine and removing the explicit requirement help? – fledgling Jun 29 '16 at 14:19
  • Yes, if you add one more agent (it can be installed [on the same machine]()https://confluence.jetbrains.com/display/TCD9/Setting+up+and+Running+Additional+Build+Agents#SettingupandRunningAdditionalBuildAgents-InstallingSeveralBuildAgentsontheSameMachine or on separate one) and remove the requirement, builds should run in parallel. – Alina Mishina Jun 29 '16 at 14:28
  • I have exactly the same problem, but my specific question is how to handle Region 1 and Region 2 configuration in the best way? Is it ok to store it as Agent's parameters? – Kamil Oct 21 '16 at 11:27