Build trigger not working property with my Perforce VCS setting


Let me explain the setup that I have.

I have a perforce client spec that has multiple projects in it. Example:

  //<project1>/trunk  //myroot/project1/trunk
  //<project1>/release-branch  //myroot/project1/release-branch
  //<project2>/trunk  //myroot/project2/trunk
  //<project2>/release-branch  //myroot/project2/release-branch

I want to build each of them separately, with the builds being triggered when a check-in is made to a particular directlry (trunk or release-branch for each project).

For example, for project1, I have done the following settings:
- VCS Root: proj1, with a client mapping of
  //<project1>/... //team-city-agent/project1/...

For trunk builds and release builds I use the same VCS Root.

For trunk build:
- I have provided the checkout directory to be the same as //myroot/project1/trunk
- Asked TC to not checkout automatically (as my script takes care of that)
- The working directory is same as the checkout directory
- There is no checkout rule

There is a very similar setup for release-branch.

This works, but obviously it triggers a build on trunk and release-branch anytime there is a checkin under //<project1>. That is if there is a check-in under //<project1>/trunk, then a build on trunk as well as release-branch is fired.

So, I started experimenting with build triggers to limit the builds to the appropriate branch and whatever change I make, there is an issue with it.

Build Trigger for trunk:

Build Trigger for release-branch:

With  this setting, TC fails to detect changes being made to any branch. No builds are triggered (obviously, as it does not detect any changes).

Now, I made a minor change to the trigger pattern, by removing the leading /

Build Trigger for trunk:

Build Trigger for release-branch:

With this setting, the changes are detected (I see pending changes), but as before builds for both branches (trunk and release-branch) detect this change. However, this time, the builds are not triggered. The pending changes list keeps growing, but the build never gets fired automatically.

I am sure I am doing something really silly with these settings. Or one of my setting (like not asking TC to not checkout or using the "Client mapping" instead of the "Client") causes this issue. But I am not able to figure out what it is. Can you please give me some suggestions?


Comment actions Permalink

Sorry for delay. Actually build trigger rules cannot affect how TeamCity detects changes. Build trigger rules can only affect how a build starts. Could you please provide an example of the change detected by TeamCity which triggered build but should not and build trigger rules currently specified for your build configuration?

Comment actions Permalink

[Sorry, long post again.. trying to explain the config as much as possible]

Hello Pavel,

Thank you for your response.

You are right, my issue with build triggers and change detection was not an issue. I was changing the configs all over the place and hence may have looked at the wrong time. They (build triggers and change detection) don't seem to be related.

However, there is a problem with the triggering of the build using build triggers. Please note that my issue is about a build that did not trigger, but it should have. Not the other way round, as you may have read it -- ie., I don't have an example where a build got triggered, but should not have. It is the other way round. TC is detecting changes and showing it as such in the overview page ("Pending(N)"). But the build never gets triggered.

I will try to explain the setup once again (using an example) below. If there is a way to zip up the config and send it to your email, I can do that as well (don't want to post the company specific build info on the message board).

Here are the build config details and then my questions at the end:

Perforce setup for our website:

- depot-path
  - website
    -- trunk
    -- releases
        -- QA
        -- LIVE

At each level (trunk, releases/QA and releases/LIVE) there is a build.proj msbuild file to build that project. This file is same across all branches (ie., no branch specific data in it).

TeamCity setup:

I have one vcs root, say: web-site.
This vcsroot is shared by builds for trunk and releases/QA and releases/LIVE.

The vcsroot has:
- Type set to Perforce
- Port set accordingly
- Client mapping radio button selected with the following mapping
  -- //<depot-path>/website/... //team-city-agent/web/...
- user/password provided
- checking interval is 600 seconds

Version Control settings for trunk:
- No checkout rule
- Do not checkout files automatically
- Checkout directory provided (c:\Perforce\Website\trunk)

Version Control settings for releases/QA:
- No checkout rule
- Do not checkout files automatically
- Checkout directory provided (c:\Perforce\Website\releases\QA)

Similarly Build Runner (uses MSBuild) is same for trunk and releases/QA except for the Working directory. The working directory is the same as the Checkout directory for each configuration.

Build Triggering for trunk (only VCS Triggering is there):
- Quiet period mode: Custom / 180 seconds
- Trigger pattern:

Build Triggering for releases/QA (only VCS Triggering is there):
- Quiet period mode: Custom / 180 seconds
- Trigger pattern:

Here are my issues and questions:

(1) With the above setup, TC does detect changes (I see "Pending(N)", with the N increasing everytime there is a check-in). But it never fires a build.
However, If I remove the trigger pattern, the builds are fired properly.

(2) This is perhaps related to your comment regarding the fact that triggers don't affect the detection of changes. With the above setup, both trunk and releases/QA detect changes across each other. I.e., the "Pending(N)" that is listed in the build overview for trunk includes changes in releases/QA and the one listed in releases/QA includes changes in trunk. However, when I do solve the build triggering issue -- (1) above -- I want the build to list changes only for that branch and not everything.

Can you please help me find what I am doing wrong?
I can provide more info (send some files to you etc) if you need.

Thank you very much for your help.


PS: All said and done, I have to mention that TC rocks!

Comment actions Permalink

Any ideas? Is it a bug with TC? Or is it a config issue on my side?
In case it is it a bug, is it fixed in the latest release (I am using 4.0.2 build 8222)

Thank you


Please sign in to leave a comment.