2

My questions is related to Trigger subsequent build once after multiple parallel builds in TeamCity but I have hit a problem so posting it here.

Below is my setup. I am trying to create a chain so that when I run A, the complete chain runs.

A ( Root project) - B ( Snapshot dependent on A + Finish Build trigger on A) -( Snapshot dependent on B) Aggregation project.

A ( Root project) - c ( Snapshot dependent on A + Finish Build trigger on A) - ( Snapshot dependent on C)Aggregation project.

The snapshot dependency does not really do anything ( there is no snapshot, I am using a dummy build config at A), I had to create that as I wanted to pass dynamic value from A down the chain using %dep which I was not able to achieve only with Finish Build trigger.

Now, I also need to be able to trigger B independently ( in that case I dont need aggregation, it is only needed when root project A is launched) so that C does not get triggered and vice versa, but with current setup when I trigger B, A gets triggered ( due to snapshot dependency, then Aggregation gets triggered, then C gets in the queue as aggregation is also snapshot dependent on C). I am new to Teamcity so I could be doing it all wrong. Any help is appreciated.

Community
  • 1
  • 1
ygsh
  • 33
  • 5
  • Do you have any automated triggers, other than the finish build trigger (which are ultimately the issue here) and if so where are they. Can you provide a bit more detail as to what each build configuration is doing? – Matt Aug 17 '16 at 17:37
  • Thanks for responding! No, I do not have automated triggers. We trigger the project twice weekly. This is a testing setup. We have separate development setup. I only need to trigger the setup when dev team asks me to run E2E tests. This is the reason I had to setup Finish build for forward chaining and snapshot dependency for passing dynamic variables so I can start from root level and accumulate all tests results from different module in aggregation project. – ygsh Aug 18 '16 at 11:29

1 Answers1

3

In order to achieve your goal, you need to:

  1. Remove the finish build triggers
  2. Ensure that that there's a snapshot dependency from B => A and from C => A
  3. Add a new build (D) that has a snapshot dependency on B and C. This will be the build to trigger when you want A, B and C to run

Triggering C will only cause A and C to run and triggering B will only cause A and B to run.

If you need help configuring this then let me know

Hope this helps

Matt
  • 3,684
  • 1
  • 17
  • 19
  • Thank you. I will try this out. I missed a critical requirement in my original post that I have listed below. I need to be able to: 1. Trigger A, which triggers B and C gets triggered. Dynamic value need to pass from A to B and B to C. ( or any other way, I just have to ensure that all three projects get the values passed) 2. At times, trigger B directly, Dynamic value need to pass from B to C. I am sorry I mentioned earlier that B does not need to trigger C. 3. And sometimes, trigger C directly. Which should not trigger anything else. – ygsh Aug 19 '16 at 02:13
  • My main issue is also with dynamic values. As far as I have read, dynamic values cannot travel up the chain. For example, If I configured D that had snapshot dependency on B and C. All three build will get triggered with dependecies, but my dynamic values will not pass to B and C and then A. Please confirm if this is correct understanding. – ygsh Aug 19 '16 at 02:19
  • If you configured D, dynamic values still start from A as this will actually be the first build configuration that is run based on snapshot dependencies, so there no issue about values travelling "upwards" because the build configuration don't run in that order. With regards to B triggering C this sounds quite convoluted and perhaps having a chat is a better way to resolve this rather then through comments. – Matt Aug 19 '16 at 06:18
  • Thanks again. As you suggested I have removed Finish Triggers now. The chain is maintained by dependency only. I have made use of reverse.dep.*. and configured this in A and B. In this way, whenever I give a value for this in A, B and C get updated. When I give value in B, only C gets updated. My requirements are met. I am able to pass values up in the dependency chain. But as you mentioned, build configs dont work this way. I will try that as well and see if reverse.dep is not needed at all and %dep should be configured in A and B instead. – ygsh Aug 19 '16 at 12:38