简体   繁体   English

不同的TeamCity构建每个git分支的计数器

[英]Different TeamCity build counter per git branch

We use gitflow and TeamCity to develop many of our products. 我们使用gitflow和TeamCity来开发我们的许多产品。 We also need to support multiple releases at the same time and work on the next release. 我们还需要同时支持多个版本并处理下一个版本。

We use support branches for previous releases and develop and master as our current and future releases which is pretty standard I think. 我们使用以前版本的支持分支,并开发和掌握我们当前和未来的版本,这是我认为非常标准的。

Is there an easy way to have a build counter set up in TeamCity for each branch without needing to check this into the repo or having different configs for each release? 是否有一种简单的方法可以在TeamCity中为每个分支设置构建计数器,而无需将其检入repo或为每个版本配置不同的配置?

For instance I want my version on one support branch I want 1.0.1.(count of builds for version 1), on develop/master I want 2.0.0.(count of builds for version 2). 例如,我希望我的版本在一个支持分支上,我希望1.0.1。(版本1的版本计数),在开发/主版我想要2.0.0。(版本2的版本计数)。

I know I can check the version in at the end of the build but was hoping there was a nicer way, we don't check anything in at the moment. 我知道我可以在构建结束时检查版本,但希望有更好的方法,我们现在不检查任何内容。

No, not that I'm aware of. 不,不是我知道的。 Currently (in TC 9.0), each branch uses the same build config. 目前(在TC 9.0中),每个分支使用相同的构建配置。 The only way I know to do what you're asking is to create a template (so all build steps would use the same template to avoid duplication) then create multiple build configs, each linked to a particular branch of the VCS. 我知道做你要问的唯一方法是创建一个模板(所以所有构建步骤都使用相同的模板来避免重复)然后创建多个构建配置,每个配置链接到VCS的特定分支。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM