Build triggering question

Hello,

I'm having trouble configuring this setup. We have three projects A, B and C. A and B depend on C. We'd like to have following trigger rules for A and B:

- Build A if there are changes in A. Build B if there are changes in B.
- Build A and B if C successfully builds
- DO NOT build A and/or B if there are changes in both A and/or B and the project C

Our SCM is Perforce, and the three projects share a common VCS root.

Is it possible to configure something like this in TeamCity? We're using version 3.1.2.

Thanks for any help,
Stephen

0
9 comments
Avatar
Permanently deleted user

I downloaded v4.5.5 to see if there was anything there that could help. It's getting closer, but it seems snapshot dependencies always get built, which results in unecessary builds. Here is the config I used for the three projects A, B, and C, where A and B depend on C:

1. A and B trigger when their source changes, and/or C builds. A and B both have a snapshot dependency on C.
2. C builds when its source changes.

For projects sharing the same VCS root, it would be great if the snapshot dependencies only built if they would normally trigger from the checkin. Again, it seems like the snapshots always build, and that creates a lot of waste.

Similarly, for projects sharing the same VCS root, if they have a trigger dependency set up between them, a source check-in shouldn't trigger the child dependency. The child should only get built if the parent successfully builds, which would be the ideal behavior.

We're using Maven for our builds. It would be great if TC could import the poms and autowire the dependencies between the builds. That would be sweet!

If there is any other approach I can take here, I'd love to hear it.

Thanks,
Stephen

0

What options do you use for snapshot dependencies? Did you enable option "Do not run new build if there is a suitable one"?

0
Avatar
Permanently deleted user

I'm using the following snapshot dependency options for both the A and B projects (they both have a snapshot dependency on C):

  • Do not run new build if there is a suitable one
  • Only use successful builds from suitable ones

Thanks for the response,
Stephen

0

And a build in C which should be taken by A and B is successful?

0
Avatar
Permanently deleted user

I'm not sure if I understand that. C has built successfully previously, and there are no changes to C in the current change set.

A, B, and C all use the same VCS root. They each have build triggers set to detect VCS changes and trigger patterns watching their portion of the VCS root. When I make a commit where there are only changes in A, C always gets built first.

0
Avatar
Permanently deleted user

If I use separate VCS roots for each project, then TC does the right thing: it only builds snapshot dependencies when required.

Do you have to use separate VCS roots with snapshot dependencies?

0

There should not be any difference whether you use the same or different VCS roots. Please describe settings of the VCS roots (or provide screenshots) for which snapshot dependencies do not work properly.

0
Avatar
Permanently deleted user

OK, here's the shared root configuration. We use Perforce, and the shared root uses this client mapping:

//team/wit/test/A/main/... //team-city-agent/A/main/...
//team/wit/test/B/main/... //team-city-agent/B/main/...
//team/wit/test/C/main/... //team-city-agent/C/main/...

Each project was set to trigger a build when there were files checked in to the VCS. A and B each had a build trigger on C. Each project also had a build trigger pattern:

A:
+:A/main/**

B:
+:B/main/**

C:
+:C/main/**

Just to be clear, if I use a separate VCS root for each project that only includes that project's sources, and remove all the build trigger patterns, this works fine.

Thanks,
Stephen

0

This looks like a bug. Please submit a bug report to our tracker: http://jetbrains.net/tracker

0

Please sign in to leave a comment.