Pending changes detection when a VCS root has parameters

We created a VCS root that includes some parameter in its URL:

Example: http://github.com/%projectname%.git

Master: %branch%

We then reused this VCS root in several build configurations with build parametrers indicating the project and the branch to build from.

This works fine when we manually trigger the builds. It can't find the pending changes automatically though. We created a build trigger to kick off the build when any changes occur in the repository, but that doesn't seem to work either.

Is this scenario supported?

11 comments
Comment actions Permalink

We also use parameters in the VCS configuration. For us it works without problems (with Subversion).
Could you post the VCS configuration and the trigger configuration?

0
Comment actions Permalink

Sure,

You can find the configuration in the attachments.

To summarize:

VCS root:

  • URL includes %system.teamcity.projectName% and %repository% (the second is a configuration parameter)
  • branch is obtained from the %branch% parameter


The VCS root is attached to a template, which has a simple VCS build trigger attached

The configuration parameters include the repository and branch parameters.



Attachment(s):
configuration_parameters.jpg
build_trigger.JPG
vcs_config.jpg
0
Comment actions Permalink

Try to check the "Trigger a build on each check-in"

0
Comment actions Permalink

We don't really want that, we just want it to trigger when a change is detected, if that change includes multiple check-ins we don't want to trigger multiple builds

0
Comment actions Permalink

I think this is the behavior of this option. Have you ever tried it?

0
Comment actions Permalink

Well, yes, I know what it does, but we just want builds to kick off sequentially, not in parallel.

On other build configurations, where we don't have any parameters in the VCS, we have the same build trigger, and those are working fine

0
Comment actions Permalink

> kick off sequentially, not in parallel.

For this purpose, shared ressources can be used.

0
Comment actions Permalink

Point is, the same build trigger works on a static VCS, why not on one that has parameters.

We're aware of the difference that that checkbox makes, we just don't want it that way. (aka, we don't want builds to kick off on each check-in, only when there are changes in the repo)

0
Comment actions Permalink

We do experience exactly the same problem since teamcity 9. I recently updated to teamcity 2017.1 in the hope that this issue might be fixed, but it's not.

Did anyone ever find a solution for this?

0
Comment actions Permalink

I'm testing using TeamCity 2018.1 with GitHub Enterprise, and https://teamcity-support.jetbrains.com/hc/en-us/community/posts/206841385-Connecting-Git-to-TeamCity-password-protection offers this as a solution for managing passwords. i.e. You define a single parameterised VCS root at the root project level, such that the username and password is entered once, and then use this from all of your projects. I'm pleased to report that TeamCity is now correctly monitoring the source, and showing pending changes. I haven't tested adding a VCS trigger, but I would imagine if it's smart enough now to show that there are pending changes, it should be smart enough to trigger the build too.

0
Comment actions Permalink

For posterity, I finally tested the VCS trigger in TeamCity 2018.1.1, when using a template VCS root. I can confirm that it correctly triggered a build on check-in.

0

Please sign in to leave a comment.