Questions about version numbering and Git

Hi all!

The team I'm working on is relatively new to TeamCity, and we have a few questions about using TC to handle version numbering.

We have a project in TC with two build configurations, called Master and Develop. Both build configurations are connected to corresponding branches in Git, and run when there's a check-in to the branch. The triggering, building and deploying all work like a charm.

Here's how we imagine version numbers to work:
Master version number: a.b.c
Develop version number: a.b.c.d
a: this is the main version number. It only gets increased on new full versions, with breaking changes, complete overhauls and similar. The developer(s) decide when it's time to increase the version number.
b: this is the sub-version number. It gets increased on new features and other changes that don't qualify for a version number increase. The developer(s) decide when it's time to increase the sub-version number. When the version number is increased, this should reset to 0.
c: build number of the Master configuration. If either the main version number or the sub-version number is increased, this should be reset to 0.
d: build number of the Develop configuration. If either of the above is altered, this should be reset to 0.

Our questions are as follows:
1) Does this approach make sense? Are we over- or underthinking things? Is there a better approach that you've had success with?
2) Is it possible for the Develop configuration to read the current version number of the Master configuration (a.b.c) and simply add its build number to the end of it?
3) Related to the above: is it possible to reset the build counter of the Develop configuration based on something happening in the Master configuration?
4) Is it possible to use a Git hook to enforce a rule that the commit message needs to contain a line on a certain format that will determine whether the current push is a new main version, a sub-version or just a build number increase, then use this information to increase the version number correspondingly?

Thanks in advance for all help!

1 comment
Comment actions Permalink

Hi Petter,

Now in TeamCity it is possible to share build number only between builds connected by a snapshot or artifact dependency, see related doc section. We have feature request -, please watch/vote for it.
Please take a look at the third-party Shared Build Number plug-in. It does not provide all functionality that you need, but I think you can modify it.

As to 4th question, you can configure it using VCS trigger rules: +|-:comment=VCS_comment_regexp.


Please sign in to leave a comment.