How to find the TeamCity build that contains a given commit to git?
Context: a git commit is detected by TeamCity and an automatic build is started.
Given the git commit hash, and the TeamCity configuration, how do you find the build in the configuration that contains the commit, without having to inspect each build manually via the web UI?
2 Solutions collect form web for “How to find the TeamCity build that contains a given commit to git?”
If you label each revision that you build (or at least each revision that builds green, which I generally want to do for other reasons), and include the build number in the label (I have “build-%system.build.number%” in “Version Control Settings” -> “Labeling pattern” for the project that I’m looking at right now), it’s just a matter of finding the first tag after the commit of interest.
In TeamCity 9 there is a clean way to a get the build(s) which contains given git commit. Just use filtering!
Build Configuration -> Change Log tab -> Advanced search -> revision: <your git revision>