Why did my TeamCity build stop working?

谁说胖子不能爱 提交于 2019-11-29 05:01:41

问题


I have a TeamCity build configuration that has been working fine until recently. Suddenly, there is a build stuck in the queue that says it is not compatible with any agents. The reason given is:

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

My BuildFormatSpecification parameter is defined thus:

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

That in turn is used in the Build Number Format field along with a build counter, like this:

%BuildFormatSpecification%.%sharedBuildNumber.id4%

The idea is that the build number comes out like "1.0.0-develop.22" and includes the Git branch being built. This follows the rules for Semantic Versioning. This scheme has worked for me over a number of projects, but suddenly this one build is stuck and I can't figure out why.

Any ideas?


回答1:


teamcity.build.branch is a predefined build parameter but it is only defined when a branch specification is configured. Therefore, to fix your problem, make sure that your build step has a VCS root configured and add e.g. +:refs/heads/(master) as your branch specification.

From TeamCity's documentation on Agent Requirements and implicit 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/why-did-my-teamcity-build-stop-working

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!