Prevent duplicate builds with the same build number

Hello,

I have the following scenario: I have a build configuration that generates a build package + release notes from the changes that are shown by TeamCity. The build gets a unique number, generated by a tool (GitVersion), which examines the git commits. Once a package is built with a version, I want to prevent multiple builds as they will get the same version, but the release notes will be empty (because TeamCity resets the changes after build). I can write a custom step to fail the build, but wanted to check if there was anything like this I can reuse.

Best,
Boyan

0
2 comments

Hi Boyan,

The only thing I can think of to prevent duplicate builds would be to make a custom step, but on the other hand, I'm not particularly sure of what could produce mutliple builds. What would be your scenario?

0
Avatar
Permanently deleted user

Hi Denis,

We use a tool (GitVersion) that generates the (semantic) version number based on the committed messages. This means when one runs a build, the build will get a version, say x.y.z based on the new changes for the default branch. If one runs another build, it will set the same version as there are no new changes. I want to prevent this, because it will genrate a second output package with no changes in the release notes.

Yes, a custom step is the only solution I can think of, but wanted to see if others have had the same problem.

Best,
Boyan

0

Please sign in to leave a comment.