Possible to have different build numbers for master vs branches when using GitFlow?

Hi

Is it possible to have different build numbers per branch from a single build configuration? I currently have issues with builds taking the latest nuget package from a feature branch when i don't want it to.

Im looking at implementing GitFlow at our company and am evaluating Git + TeamCity (along with other tools) to try and implement this the best i can. I am a bit new to git so maybe im just doing somthing wrong conceptually?

A simple example:

In Git i have 2 repos. One for proj A and one for proj B
TC is set up to look at both repos and their vcs roots are set up as follows:

Capture.PNG


Proj A references Proj B. So Proj B is built as a nuget package to the TC nuget feed. Proj A is set to update the versions of the nuget package up to a major version change (using the nuget bersion rules in the packages.config).

The problem is when i feature branch proj B and commit, the version is incremented in the same was it is for master and so any further builds (for say a hotfix) of proj A will use proj B's nuget package that is still in feature branched status? This isn't what i want.

So, do i need to have different configurations for feature, develop, master? So duplicating work in TC?

What are the best practices when setting this kind of workflow up? we are wanting to use the nuget feed for all out .net dependencies.

Any guidance would be much appreciated!

Thanks

1 comment
Comment actions Permalink

Hi Justin,

At the moment it is not possible to configure branch specific parameters. Please watch and vote for the related feature request.
Current workarounds are:
1. Create separate build configuration. You can use templates to simplify the setup.
2. Add extra step with the following logic: https://youtrack.jetbrains.com/issue/TW-24275#comment=27-403264 and set build number using service message:

##teamcity[buildNumber '<new build number>'].
To store different counters you can use Shared Build Number plugin.
0

Please sign in to leave a comment.