git - 为什么我的 TeamCity 构建停止工作?

我有一个 TeamCity 构建配置,直到最近它一直运行良好。突然,有一个构建卡在队列中,说它与任何代理都不兼容。给出的理由是:

Implicit requirements: teamcity.build.branch defined in Parameter: BuildFormatSpecification

我的 BuildFormatSpecification 参数是这样定义的:

%MajorVersion%.%MinorVersion%.%PatchVersion%-%teamcity.build.branch%

这又在 Build Number Format 字段中与构建计数器一起使用,如下所示:

%BuildFormatSpecification%.%sharedBuildNumber.id4%

这个想法是构建号像“1.0.0-develop.22”一样出现,并包括正在构建的 Git 分支。这遵循语义版本控制的规则。这个方案在很多项目中都对我有用,但是突然这个构建卡住了,我不知道为什么。

有什么想法吗?

最佳答案

teamcity.build.branch 是 predefined build parameter但它仅在 branch specification 时定义已配置。因此,要解决您的问题,请确保您的构建步骤配置了 VCS 根目录并添加例如+:refs/heads/(master) 作为你的分支规范。

来自 TeamCity 关于 Agent Requirements 的文档和隐含的要求:

Any reference (name in %-signs) to an unknown parameter is considered an "implicit requirement". That means that the build will only run on the agent which provides the parameters named.

Otherwise, the parameter should be made available for the build configuration by defining it on the build configuration or project levels.

https://stackoverflow.com/questions/22314229/

相关文章:

logging - 渐变颜色输出

java - 在java中构建URL

visual-studio - Visual Studio : debug information

build - 在 CentOS/RHEL 上制作和构建实用程序?

带有 CLI 的 Angular 2 - 为生产而构建

groovy - Gradle:强制自定义任务始终运行(无缓存)

c++ - 在 Sublime Text 中构建系统

go - 如何正确使用构建标签?

build - 具有项目编译依赖项的 Gradle 嵌套多项目

c++ - 在一个 Eclipse 项目中构建多个二进制文件