Non-polling VCS roots?

AFAICS VCS roots in TeamCity always poll, or am I missing something?
A quick search leads to VCSUpdate, could something similar be provided out-of-the-box, perhaps by extending the REST API?

In a complete solution, I'd like to trigger builds from SCM Manager (which already has plugins for Jenkins and Bamboo;
the latter one would be easy to adapt by adding a toggle for Bamboo/TC specific URL; TC root id could be used instead of a Bamboo plan key).

9 comments
Comment actions Permalink

Hi,

Yes, TeamCity always polls VCS roots. The checking interval specifies how often TeamCity polls the VCS repository for VCS changes. It is possible to trigger build using REST API.

0
Comment actions Permalink

I want to trigger a poll (or pull :)) on a VCS root, which would eventually trigger a build.
Or does TeamCity work so that a build would update source code automatically?

In any case, for Mercurial, one may trigger different builds for tagging and regular commits to the same repository.
Or, VCS roots may be parameterized so that they could be used by multiple projects.

It seems easier to alert TeamCity to a source code change and let it decide which build to start.
Otherwise, SCM trigger/plugin may need some quite heavy logic to decide which particular build must be started.

0
Comment actions Permalink

When the build is triggered server or agent (depending on checkout mode) checks for changes and checks out the sources before the build. Please see the Build Lifecycle diagram.

VCS roots are created on Project level and can be attached to multiple build configurations. On the other hand you can create the same VCS roots in different projects.


Since TeamCity 8.0 you can force VCS Root check using REST API:

POST http://teamcityserver/app/rest/debug/vcsCheckingForChangesQueue?locator=<vcsRootInstanceLocator>

where <vcsRootInstanceLocator> is:

buildType:(id:<extrnalBuildCOnfigurationID>)
project:(id:<extrnalProjectID>)
vcsRoot:(id:<extrnalVCSRootID>)

For more details see this comment and this comment.

0
Comment actions Permalink

Thanks for looking up all these discussions for me! I was apparently using wrong terms for my search, since I missed it all, even the API in application.wadl .
Now on to hacking the SCM Manager plugin :)

One final wish: when API makes it out of "experimental", could TeamCity accept "0" as a valid checking interval meaning "no polling" (instead of random large integer)?

0
Comment actions Permalink

Unfortunately it is not possible now. Please vote for related feature request - https://youtrack.jetbrains.com/issue/TW-4134.

0
Comment actions Permalink

I have a working implementation for stash, if anyone is interested

https://github.com/jmecosta/TeamcityTriggerHook

0
Comment actions Permalink

An RFE, perhaps: I would like to trigger checks based on build configuration id; the currect selector scheme is too coarse-grained.
I can, it seems, use a parameterized VCS root and trigger checks on root instances by using id:<number>, but it is a bit non-obvious.

0
Comment actions Permalink

Hello,

Could you please clarify what do you mean by "trigger checks based on build configuration id"? Is <vcsRootInstanceLocator> = buildType:(id:<extrnalBuildCOnfigurationID>) locator not suitable for this case?

0
Comment actions Permalink

Thanks for pointing out the obvious... :8}

0

Please sign in to leave a comment.