1

I have a build-server, implemented with team-city. Until now, I have an input parameter that represent the first 3 parts of the version number (x.y.z) = %Version.Number%

When I compile my exe files, I set the file version to be: %Version.Number%.%build_number% and then I get a 4 parts version number.

The problem with that solution is that there is no connection between the first 3 parts of the version number and the build number.

Now, I want to find a way to have a different set of %build_number% for each %Version.Number%.

I will illustrate the problem with an example:

On the first build when %Version.Number% = 15.3.2 - the version number will be 15.3.2.0 .

On the second build when %Version.Number% = 15.3.2 - the version number will be 15.3.2.1 .

Now, on a new build when %Version.Number% = 16.0.0 - the version number will be 16.0.0.2 and I want to be 16.0.0.0.

Thanks.

2 Answers 2

1

Two ways to handle this, at least:

  • Use the Version Number Plugin -
    it will allow you to reset the "running" build number whenever you like -
    simply set the next-build-number to '1' whenever the major release is increased
    (as a bonus, it also lets you format the version-number with leading-zeroes and such).

  • Create a new job whenever you increase the major release number -

    1. copy build_job_15.3.2 to build_job_16.0.0
    2. edit the version-number in build_job_16.0.0 to be '16.0.0'
    3. optional: disable build_job_15.3.2

    Now you can run build_job_16.0.0, and the build number will start with '1'
    (this method is a bit tedious, but allows you to continue building 15.3.2 releases, if needed).

Sign up to request clarification or add additional context in comments.

2 Comments

Are those ways relevant to Team-City build server as well?
Will answer with a question: Can you "inject" a version-number to Team-City? (in other words: If Team-City will accept a parameter from Jenkins that is the version-number, then you are OK, but if Team-City is setting its own version-number, then this will not work).
1

You are able to reset the build number counter in the General Settings of the Build Configuration. Is that not sufficient for your scenario?

1 Comment

I don't want someone (probably be me :) ) to click on this link on every new major version. In addition, I want to be able to build an old major version and give it the last build number of that version plus 1.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.