Build Triggering Question

We are running TC 5.0.1 and I have a question regarding triggering builds.

Is there a way to put a condition on a build trigger? E.G. If there was a successful build in the last n minutes do not trigger another build of this project.

5 comments

Steven,

There is no such ability. All the options that are available are visible in the UI for build triggers.
The closest one is quiet period of VCS trigger: it waits for the specified time since a change detection before triggering a new build. However, it pays no attantion to the previous build time and state.

Can you describe why do you need the option you mentioned?

If you try to prevent too frequent builds, you can find TW-10905 issue relevant.

0

Hi, and thanks for the response.

Was not able to get to the issue at the link you provided but here is a synopsis of why I asked the question.

So let's say I have a number of builds in a project named (A, B, C, D). This is similar to the real configuration that we have.

A is a build for a common shared library used in multiple applications.
B and C are service applications that utilize A. Both B and C have a build trigger dependancy of A.
D is a client application that uses B & C, as well as, A. It has a build trigger dependancy of A, B, and C.

If a build runs for A, B, C, and D builds are then triggered.
After B & C run then D is triggered again.

The second triggering of D in not really needed in this case and occurs just minutes after the previous build triggered by the A build.

Perhaps there is a better way to do this and I would be open to suggestions.

0

Steven,

Looks like TW-5272.

You can try to use snapshot dependencies instead of dependency triggers. This way all the builds: D, B, C and A will be put into the queue and will be built in correct order. They will also use the same sources snapshot. In thic configuration only D can have VCS trigger with "Trigger on changes in snapshot dependencies" turned ON.

0

Yegor,

So if I am understanding your suggestion correctly then:

D would have snapshot dependancies of C,B, and A in addition to having Trigger on changes in snapshot dependencies option selected
C and B would have a snapshot dependancy of A

That would then mean that if there were a change in A,B, or C then a build of D would also be triggered but would wait until A, B, and C completed. B and C would also wait until A complete since they also have a snapshot dependancy with A. Does that sound correct?

Also, would I not want B and C to have Trigger on changes in snapshot dependencies turned on becuase I also want those to run if A is built?

Thanks again!

0

Steven,

That would then mean that if there were a change in A,B, or C then a build of D would also be triggered but would wait until A, B, and C completed. B and C would also wait until A complete since they also have a snapshot dependancy with A. Does that sound correct?

As far as I understand your setup the answer is Yes, this is correct.

so, would I not want B and C to have Trigger on changes in snapshot dependencies turned on becuase I also want those to run if A is built?

If you have the trigger option in D, then on any change in A, B and C will be triggered (to allow D to run), so this way you will have B and C run on any change in A.

0

Please sign in to leave a comment.